1
0
Fork 0

Allow the `terminal` module auto-title for tmux

Allows the user to selectively enable auto window titles in
tmux. Defaults to not using window titles in tmux.
pull/807/head
Derek Chen-Becker 10 years ago
parent 88aee30ae8
commit b90e7dd400

@ -74,7 +74,12 @@ function _terminal-set-titles-with-path {
local truncated_path="${abbreviated_path/(#m)?(#c15,)/...${MATCH[-12,-1]}}"
unset MATCH
if zstyle -t ':prezto:module:terminal' auto-tmux-title && [[ -n "$TMUX" ]]
then
set-window-title "$truncated_path"
else
set-window-title "$abbreviated_path"
fi
set-tab-title "$truncated_path"
}
@ -111,7 +116,8 @@ fi
# Set up non-Apple terminals.
if zstyle -t ':prezto:module:terminal' auto-title \
&& ( ! [[ -n "$STY" || -n "$TMUX" ]] )
&& ( ! [[ -n "$STY" ]] ) \
&& ( ( ! [[ -n "$TMUX" ]] ) || zstyle -t ':prezto:module:terminal' auto-tmux-title )
then
# Sets the tab and window titles before the prompt is displayed.
add-zsh-hook precmd _terminal-set-titles-with-path
@ -119,3 +125,4 @@ then
# Sets the tab and window titles before command execution.
add-zsh-hook preexec _terminal-set-titles-with-command
fi

Loading…
Cancel
Save