Prepend tmux session name to Xterm title

This commit is contained in:
Eryn Wells 2013-04-04 09:41:07 -07:00
parent fd7173ff72
commit 28397d8b32

View file

@ -110,10 +110,18 @@ function set_prompt_info
function set_xterm_title
{
local title=''
if [[ -n "$TMUX" ]]; then
title+="`tmux display-message -p '#S'`: "
fi
# Set xterm and screen titles
if [[ -n "$DISPLAY" || -n "$TERM_PROGRAM" ]]; then
print -Pn "\e]2;%n@%m\a"
title+="%n@%m"
fi
print -Pn "\e]2;${title}\a"
}