]> git.rmz.io Git - dotfiles.git/blob - zsh/lib/title.zsh
vim: use con for ToggleNumber
[dotfiles.git] / zsh / lib / title.zsh
1 function title {
2 local tmp
3 tmp=(${(f)*})
4 printf "\e]0;%s\a" "${tmp[1]}"
5 }
6
7 case "$TERM" in
8 (*xterm*|rxvt*)
9 function title_precmd { title "${(%):-[%n@%m] %~}" }
10 function title_preexec { title "$1" }
11 ;;
12 (*)
13 function title_precmd {}
14 function title_preexec {}
15 ;;
16 esac
17
18 autoload -U add-zsh-hook
19 add-zsh-hook precmd title_precmd
20 add-zsh-hook preexec title_preexec