1
0
Fork 0

Disable auto-start for multiplexers with SSH

Do not automatically start multiplexers if the machine is access with a
remote connection (SSH).
This avoids having the 'remote' screen or tmux session embedded in the local
session
pull/292/head
Colin Hebert 12 years ago
parent fb4ffd9883
commit 75682fb87f

@ -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
-------

@ -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' \

@ -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
-------

@ -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

@ -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'

Loading…
Cancel
Save