mirror of https://github.com/ohmyzsh/ohmyzsh.git
Merge c1d06b2365
into d689aa289e
This commit is contained in:
commit
006eb43a1f
|
@ -15,6 +15,8 @@ fi
|
||||||
: ${ZSH_TMUX_AUTOQUIT:=$ZSH_TMUX_AUTOSTART}
|
: ${ZSH_TMUX_AUTOQUIT:=$ZSH_TMUX_AUTOSTART}
|
||||||
# Automatically name the new session based on the basename of PWD
|
# Automatically name the new session based on the basename of PWD
|
||||||
: ${ZSH_TMUX_AUTONAME_SESSION:=false}
|
: ${ZSH_TMUX_AUTONAME_SESSION:=false}
|
||||||
|
# Automatically pick up tmux environments
|
||||||
|
: ${ZSH_TMUX_AUTOREFRESH:=true}
|
||||||
# Set term to screen or screen-256color based on current terminal support
|
# Set term to screen or screen-256color based on current terminal support
|
||||||
: ${ZSH_TMUX_DETACHED:=false}
|
: ${ZSH_TMUX_DETACHED:=false}
|
||||||
# Set detached mode
|
# Set detached mode
|
||||||
|
@ -158,6 +160,15 @@ function _zsh_tmux_plugin_run() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Refresh tmux environment variables.
|
||||||
|
function _zsh_tmux_plugin_preexec()
|
||||||
|
{
|
||||||
|
local -a tmux_cmd
|
||||||
|
tmux_cmd=(command tmux)
|
||||||
|
|
||||||
|
eval $($tmux_cmd show-environment -s)
|
||||||
|
}
|
||||||
|
|
||||||
# Use the completions for tmux for our function
|
# Use the completions for tmux for our function
|
||||||
compdef _tmux _zsh_tmux_plugin_run
|
compdef _tmux _zsh_tmux_plugin_run
|
||||||
# Alias tmux to our wrapper function.
|
# Alias tmux to our wrapper function.
|
||||||
|
@ -184,3 +195,9 @@ if [[ -z "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" && -z "$INSIDE_EMACS" && -z
|
||||||
_zsh_tmux_plugin_run
|
_zsh_tmux_plugin_run
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Automatically refresh tmux environments if tmux is running.
|
||||||
|
if [[ -n "$TMUX" && "$ZSH_TMUX_AUTOREFRESH" == "true" ]] && tmux ls >/dev/null 2>/dev/null; then
|
||||||
|
autoload -U add-zsh-hook
|
||||||
|
add-zsh-hook preexec _zsh_tmux_plugin_preexec
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue