Skip to content

Instantly share code, notes, and snippets.

@alesandar
Created May 4, 2017 02:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alesandar/0540e337532745d224ee90c24f8e7a08 to your computer and use it in GitHub Desktop.
Save alesandar/0540e337532745d224ee90c24f8e7a08 to your computer and use it in GitHub Desktop.
# set tmux pane and tab title
function tmux_title_precmd() {
print -Pn "\e]2;zsh\a"
print -Pn "\e]1;zsh\a"
}
function tmux_title_preexec() {
print -Pn "\e]2;$(echo "$1" | cut -d" " -f1)\a"
print -Pn "\e]1;$1\a"
# print -Pn "\e]2;$2:q\a"
}
if [[ "$TERM" == (screen*|tmux*) ]]; then
add-zsh-hook -Uz precmd tmux_title_precmd
add-zsh-hook -Uz preexec tmux_title_preexec
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment