Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
bc654437
Commit
bc654437
authored
Jun 22, 2013
by
Andrew Schwartzmeyer
Browse files
Adding support for iTerm2 tmux integration via option '-CC'
parent
78dba754
Changes
1
Hide whitespace changes
Inline
Side-by-side
plugins/tmux/tmux.plugin.zsh
View file @
bc654437
...
...
@@ -14,6 +14,8 @@ if which tmux &> /dev/null
[[
-n
"
$ZSH_TMUX_AUTOQUIT
"
]]
||
ZSH_TMUX_AUTOQUIT
=
$ZSH_TMUX_AUTOSTART
# Set term to screen or screen-256color based on current terminal support
[[
-n
"
$ZSH_TMUX_FIXTERM
"
]]
||
ZSH_TMUX_FIXTERM
=
true
# Set '-CC' option for iTerm2 tmux integration
[[
-n
"
$$
ZSH_TMUX_ITERM2"
]]
||
ZSH_TMUX_ITERM2
=
false
# The TERM to use for non-256 color terminals.
# Tmux states this should be screen, but you may need to change it on
# systems without the proper terminfo
...
...
@@ -55,11 +57,11 @@ if which tmux &> /dev/null
# Try to connect to an existing session.
elif
[[
"
$ZSH_TMUX_AUTOCONNECT
"
==
"true"
]]
then
\t
mux
attach
||
\t
mux
`
[[
"
$ZSH_TMUX_FIXTERM
"
==
"true"
]]
&&
echo
'-f '
$_ZSH_TMUX_FIXED_CONFIG
`
new-session
\t
mux
`
[[
"
$ZSH_TMUX_ITERM2
"
==
"true"
]]
&&
echo
'-CC '
`
attach
||
\t
mux
`
[[
"
$ZSH_TMUX_ITERM2
"
==
"true"
]]
&&
echo
'-CC '
`
`
[[
"
$ZSH_TMUX_FIXTERM
"
==
"true"
]]
&&
echo
'-f '
$_ZSH_TMUX_FIXED_CONFIG
`
new-session
[[
"
$ZSH_TMUX_AUTOQUIT
"
==
"true"
]]
&&
exit
# Just run tmux, fixing the TERM variable if requested.
else
\t
mux
`
[[
"
$ZSH_TMUX_FIXTERM
"
==
"true"
]]
&&
echo
'-f '
$_ZSH_TMUX_FIXED_CONFIG
`
\t
mux
`
[[
"
$ZSH_TMUX_ITERM2
"
==
"true"
]]
&&
echo
'-CC '
`
`
[[
"
$ZSH_TMUX_FIXTERM
"
==
"true"
]]
&&
echo
'-f '
$_ZSH_TMUX_FIXED_CONFIG
`
[[
"
$ZSH_TMUX_AUTOQUIT
"
==
"true"
]]
&&
exit
fi
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment