43c50f03e3c547ec51feef7ae3c99f734a66e6a6
- Author
- Josh Matthews <jmatth@nbcs.rutgers.edu>
- Committer
- Josh Matthews <jmatth@nbcs.rutgers.edu>
- Date
Message
Checking environment instead of local variable for fixing term in tmux plugin.
Diff
1diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh
2index 46c142b775c43157039982df8150f6c00ee3e4ef..9a52e6376617b908ecc05bc10b870c8cb72afc91 100644
3--- a/plugins/tmux/tmux.plugin.zsh
4+++ b/plugins/tmux/tmux.plugin.zsh
5@@ -23,16 +23,13 @@ fi
6 local fixed_config=""
7
8 # Set the correct local config file to use.
9-if [[ "$ZSH_TMUX_FIXTERM" == "true" ]]
10+if [[ -f $HOME/.tmux.conf || -h $HOME/.tmux.conf ]]
11 then
12- if [[ -f $HOME/.tmux.conf || -h $HOME/.tmux.conf ]]
13- then
14- #use this when they have a ~/.tmux.conf
15- fixed_config="$zsh_tmux_plugin_path/tmux.extra.conf"
16- else
17- #use this when they don't have a ~/.tmux.conf
18- fixed_config="$zsh_tmux_plugin_path/tmux.only.conf"
19- fi
20+ #use this when they have a ~/.tmux.conf
21+ fixed_config="$zsh_tmux_plugin_path/tmux.extra.conf"
22+else
23+ #use this when they don't have a ~/.tmux.conf
24+ fixed_config="$zsh_tmux_plugin_path/tmux.only.conf"
25 fi
26
27 # Wrapper function for tmux.
28@@ -45,11 +42,11 @@ function zsh_tmux_plugin_run()
29 # Try to connect to an existing session.
30 elif [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]]
31 then
32- \tmux attach || \tmux `[[ -n "$fixed_config" ]] && echo '-f ' $fixed_config` new-session
33+ \tmux attach || \tmux `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$fixed_config` new-session
34 [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit
35 # Just run tmux, fixing the TERM variable if requested.
36 else
37- \tmux `[[ -n "$fixed_config" ]] && echo '-f ' $fixed_config`
38+ \tmux `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$fixed_config`
39 [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit
40 fi
41 }