Honor ZSH_TMUX_ITERM2 for new-session and attach

This commit is contained in:
Zbigniew Mandziejewicz 2015-09-29 00:39:08 +08:00
parent 52e2aaee06
commit 6ee04702e2

View File

@ -60,8 +60,12 @@ if which tmux &> /dev/null
# Wrapper function for tmux.
function _zsh_tmux_plugin_run()
{
# We attach to existing or start new session
if [[ -n "${@[(r)attach]}" || -n "${@[(r)new-session]}" ]]
then
\tmux `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` $@
# We have other arguments, just run them
if [[ -n "$@" ]]
elif [[ -n "$@" ]]
then
\tmux $@
# Try to connect to an existing session.