diff options
author | Josh Matthews <jmatth@nbcs.rutgers.edu> | 2013-02-26 21:52:26 -0500 |
---|---|---|
committer | Josh Matthews <jmatth@nbcs.rutgers.edu> | 2013-02-26 22:29:26 -0500 |
commit | 43c50f03e3c547ec51feef7ae3c99f734a66e6a6 (patch) | |
tree | 17b20bff96e8d6e51e669e21f968d05c3917b0bc /plugins/tmux | |
parent | 7b15627851983e63a5756f0b3633938c44ed7a7d (diff) | |
download | zsh-43c50f03e3c547ec51feef7ae3c99f734a66e6a6.tar.gz zsh-43c50f03e3c547ec51feef7ae3c99f734a66e6a6.tar.bz2 zsh-43c50f03e3c547ec51feef7ae3c99f734a66e6a6.zip |
Checking environment instead of local variable for fixing term in tmux plugin.
Diffstat (limited to 'plugins/tmux')
-rw-r--r-- | plugins/tmux/tmux.plugin.zsh | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 46c142b77..9a52e6376 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -23,16 +23,13 @@ fi local fixed_config="" # Set the correct local config file to use. -if [[ "$ZSH_TMUX_FIXTERM" == "true" ]] +if [[ -f $HOME/.tmux.conf || -h $HOME/.tmux.conf ]] then - if [[ -f $HOME/.tmux.conf || -h $HOME/.tmux.conf ]] - then - #use this when they have a ~/.tmux.conf - fixed_config="$zsh_tmux_plugin_path/tmux.extra.conf" - else - #use this when they don't have a ~/.tmux.conf - fixed_config="$zsh_tmux_plugin_path/tmux.only.conf" - fi + #use this when they have a ~/.tmux.conf + fixed_config="$zsh_tmux_plugin_path/tmux.extra.conf" +else + #use this when they don't have a ~/.tmux.conf + fixed_config="$zsh_tmux_plugin_path/tmux.only.conf" fi # Wrapper function for tmux. @@ -45,11 +42,11 @@ function zsh_tmux_plugin_run() # Try to connect to an existing session. elif [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] then - \tmux attach || \tmux `[[ -n "$fixed_config" ]] && echo '-f ' $fixed_config` new-session + \tmux attach || \tmux `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$fixed_config` new-session [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit # Just run tmux, fixing the TERM variable if requested. else - \tmux `[[ -n "$fixed_config" ]] && echo '-f ' $fixed_config` + \tmux `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$fixed_config` [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit fi } |