diff --git a/modules/screen/README.md b/modules/screen/README.md index 976b483a..acecc208 100644 --- a/modules/screen/README.md +++ b/modules/screen/README.md @@ -14,6 +14,15 @@ To enable this feature, add the following line to *zpreztorc*: zstyle ':prezto:module:screen' auto-start 'yes' +#### SSH and auto-start + +To avoid having screen sessions inside screen sessions, auto-start is disabled for +SSH access. + +It is possible to re-enable auto-start for SSH sessions with + + zstyle ':prezto:module:screen' remote 'yes' + Aliases ------- diff --git a/modules/screen/init.zsh b/modules/screen/init.zsh index 424f6584..8c00533a 100644 --- a/modules/screen/init.zsh +++ b/modules/screen/init.zsh @@ -14,7 +14,8 @@ fi # Auto Start # -if [[ -z "$STY" ]] && zstyle -t ':prezto:module:screen' auto-start; then +if ( [[ -z "$SSH_CLIENT" ]] || zstyle -t ':prezto:module:screen' remote ) && + ( [[ -z "$STY" ]] && zstyle -t ':prezto:module:screen' auto-start ); then session="$( screen -list 2> /dev/null \ | sed '1d;$d' \ diff --git a/modules/tmux/README.md b/modules/tmux/README.md index b5e1011a..02a4e885 100644 --- a/modules/tmux/README.md +++ b/modules/tmux/README.md @@ -21,6 +21,15 @@ To avoid keeping open sessions, this module sets `destroy-unattached off` on the background session and `destroy-unattached on` on every other session (global setting). +#### SSH and auto-start + +To avoid having tmux sessions inside tmux sessions, auto-start is disabled for +SSH access. + +It is possible to re-enable auto-start for SSH sessions with + + zstyle ':prezto:module:tmux' remote 'yes' + Aliases ------- diff --git a/modules/tmux/init.zsh b/modules/tmux/init.zsh index a4648276..f54008fa 100644 --- a/modules/tmux/init.zsh +++ b/modules/tmux/init.zsh @@ -15,7 +15,8 @@ fi # Auto Start # -if [[ -z "$TMUX" ]] && zstyle -t ':prezto:module:tmux' auto-start; then +if ( [[ -z "$SSH_CLIENT" ]] || zstyle -t ':prezto:module:tmux' remote ) && + ( [[ -z "$TMUX" ]] && zstyle -t ':prezto:module:tmux' auto-start ); then tmux_session='#Prezto' if ! tmux has-session -t "$tmux_session" 2> /dev/null; then diff --git a/runcoms/zpreztorc b/runcoms/zpreztorc index 66cddb52..65b8ec4a 100644 --- a/runcoms/zpreztorc +++ b/runcoms/zpreztorc @@ -81,6 +81,9 @@ zstyle ':prezto:module:prompt' theme 'sorin' # Auto start a session when Zsh is launched. # zstyle ':prezto:module:screen' auto-start 'yes' +# Allow auto-start with an SSH connection +# zstyle ':prezto:module:screen' remote 'yes' + # # SSH-Agent # @@ -118,3 +121,5 @@ zstyle ':prezto:module:terminal' auto-title 'yes' # Auto start a session when Zsh is launched. # zstyle ':prezto:module:tmux' auto-start 'yes' +# Allow auto-start with an SSH connection +# zstyle ':prezto:module:tmux' remote 'yes'