mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-16 02:40:08 +00:00
fix(tmux): regression with detached sessions
See https://github.com/ohmyzsh/ohmyzsh/pull/12242#issuecomment-1973236605
This commit is contained in:
parent
9730915910
commit
0008534147
1 changed files with 4 additions and 2 deletions
|
@ -100,11 +100,13 @@ function _zsh_tmux_plugin_run() {
|
||||||
[[ "$ZSH_TMUX_ITERM2" == "true" ]] && tmux_cmd+=(-CC)
|
[[ "$ZSH_TMUX_ITERM2" == "true" ]] && tmux_cmd+=(-CC)
|
||||||
[[ "$ZSH_TMUX_UNICODE" == "true" ]] && tmux_cmd+=(-u)
|
[[ "$ZSH_TMUX_UNICODE" == "true" ]] && tmux_cmd+=(-u)
|
||||||
|
|
||||||
|
local _detached=""
|
||||||
|
[[ "$ZSH_TMUX_DETACHED" == "true" ]] && _detached="-d"
|
||||||
# Try to connect to an existing session.
|
# Try to connect to an existing session.
|
||||||
if [[ -n "$ZSH_TMUX_DEFAULT_SESSION_NAME" ]]; then
|
if [[ -n "$ZSH_TMUX_DEFAULT_SESSION_NAME" ]]; then
|
||||||
[[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] && $tmux_cmd attach ${ZSH_TMUX_DETACHED:+"-d"} -t $ZSH_TMUX_DEFAULT_SESSION_NAME
|
[[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] && $tmux_cmd attach $_detached -t $ZSH_TMUX_DEFAULT_SESSION_NAME
|
||||||
else
|
else
|
||||||
[[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] && $tmux_cmd attach ${ZSH_TMUX_DETACHED:+"-d"}
|
[[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] && $tmux_cmd attach $_detached
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If failed, just run tmux, fixing the TERM variable if requested.
|
# If failed, just run tmux, fixing the TERM variable if requested.
|
||||||
|
|
Loading…
Reference in a new issue