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