From fc1fe1fe0b07bd5d306a7d94faf17a9f41033c4a Mon Sep 17 00:00:00 2001 From: Kutsan Kaplan Date: Wed, 18 Jan 2017 17:00:59 +0200 Subject: [PATCH] Add tmux optional default session name instead of 0 --- plugins/tmux/tmux.plugin.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index fb514a44c..fa90c0a5f 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -35,6 +35,8 @@ if which tmux &> /dev/null # Tmux states this should be screen-256color, but you may need to change it on # systems without the proper terminfo [[ -n "$ZSH_TMUX_FIXTERM_WITH_256COLOR" ]] || ZSH_TMUX_FIXTERM_WITH_256COLOR="screen-256color" + # Set default session name if there is one + [[ -n "$ZSH_TMUX_DEFAULT_SESSION_NAME" ]] || ZSH_TMUX_DEFAULT_SESSION_NAME='0' # Get the absolute path to the current directory @@ -68,7 +70,7 @@ if which tmux &> /dev/null # Try to connect to an existing session. elif [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] then - \tmux `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` attach || \tmux `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG` new-session + \tmux `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` attach || \tmux `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG` new-session -s $ZSH_TMUX_DEFAULT_SESSION_NAME [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit # Just run tmux, fixing the TERM variable if requested. else