fix(shell): run tmux hook only if tmux is active

This commit is contained in:
2024-02-06 12:55:55 +02:00
parent 13764775ca
commit b904f0b60e

View File

@@ -85,6 +85,8 @@ x-have rbenv && {
eval "$(rbenv init - zsh)" eval "$(rbenv init - zsh)"
} }
# Run only if tmux is active
[[ -n "$TMUX" ]] && {
# Autoupdate tmux window name # Autoupdate tmux window name
TMUX_WINDOW_NAME_PLUGIN="$DOTFILES/config/tmux/plugins/tmux-window-name/scripts/rename_session_windows.py" TMUX_WINDOW_NAME_PLUGIN="$DOTFILES/config/tmux/plugins/tmux-window-name/scripts/rename_session_windows.py"
[ -f "$TMUX_WINDOW_NAME_PLUGIN" ] && { [ -f "$TMUX_WINDOW_NAME_PLUGIN" ] && {
@@ -93,6 +95,8 @@ TMUX_WINDOW_NAME_PLUGIN="$DOTFILES/config/tmux/plugins/tmux-window-name/scripts/
($TMUX_WINDOW_NAME_PLUGIN &) ($TMUX_WINDOW_NAME_PLUGIN &)
} }
add-zsh-hook chpwd tmux-window-name add-zsh-hook chpwd tmux-window-name
tmux-window-name
}
} }
# eval "$(starship init zsh)" # eval "$(starship init zsh)"