bc65443734ec96ddc8da61c022d630fa8303765a
- Author
- Andrew Schwartzmeyer <andrew.schwartzmeyer@gmail.com>
- Committer
- Andrew Schwartzmeyer <andrew.schwartzmeyer@gmail.com>
- Date
Message
Adding support for iTerm2 tmux integration via option '-CC'
Diff
1diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh
2index 465f5b053696789317b2854c20764d585f337424..5bd946f0895b556e8d6ff31eb493361775e863ac 100644
3--- a/plugins/tmux/tmux.plugin.zsh
4+++ b/plugins/tmux/tmux.plugin.zsh
5@@ -14,6 +14,8 @@ if which tmux &> /dev/null
6 [[ -n "$ZSH_TMUX_AUTOQUIT" ]] || ZSH_TMUX_AUTOQUIT=$ZSH_TMUX_AUTOSTART
7 # Set term to screen or screen-256color based on current terminal support
8 [[ -n "$ZSH_TMUX_FIXTERM" ]] || ZSH_TMUX_FIXTERM=true
9+ # Set '-CC' option for iTerm2 tmux integration
10+ [[ -n "$$ZSH_TMUX_ITERM2" ]] || ZSH_TMUX_ITERM2=false
11 # The TERM to use for non-256 color terminals.
12 # Tmux states this should be screen, but you may need to change it on
13 # systems without the proper terminfo
14@@ -55,11 +57,11 @@ if which tmux &> /dev/null
15 # Try to connect to an existing session.
16 elif [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]]
17 then
18- \tmux attach || \tmux `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG` new-session
19+ \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
20 [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit
21 # Just run tmux, fixing the TERM variable if requested.
22 else
23- \tmux `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG`
24+ \tmux `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG`
25 [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit
26 fi
27 }