diff options
| author | Carlo Sala <carlosalag@protonmail.com> | 2024-03-01 16:44:20 +0100 |
|---|---|---|
| committer | Carlo Sala <carlosalag@protonmail.com> | 2024-03-01 16:44:20 +0100 |
| commit | 0008534147a28eeeea52cfd92154ae2e801678ae (patch) | |
| tree | d38ef618e1deaf3f2145ec87e9cb9fcca107629b /plugins/tmux | |
| parent | 9730915910c6cc7640f8af6063ffb93becf0414a (diff) | |
| download | zsh-0008534147a28eeeea52cfd92154ae2e801678ae.tar.gz zsh-0008534147a28eeeea52cfd92154ae2e801678ae.tar.bz2 zsh-0008534147a28eeeea52cfd92154ae2e801678ae.zip | |
fix(tmux): regression with detached sessions
See https://github.com/ohmyzsh/ohmyzsh/pull/12242#issuecomment-1973236605
Diffstat (limited to 'plugins/tmux')
| -rw-r--r-- | plugins/tmux/tmux.plugin.zsh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 436e2671d..11550d687 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -100,11 +100,13 @@ function _zsh_tmux_plugin_run() { [[ "$ZSH_TMUX_ITERM2" == "true" ]] && tmux_cmd+=(-CC) [[ "$ZSH_TMUX_UNICODE" == "true" ]] && tmux_cmd+=(-u) + local _detached="" + [[ "$ZSH_TMUX_DETACHED" == "true" ]] && _detached="-d" # Try to connect to an existing session. 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 - [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] && $tmux_cmd attach ${ZSH_TMUX_DETACHED:+"-d"} + [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] && $tmux_cmd attach $_detached fi # If failed, just run tmux, fixing the TERM variable if requested. |
