aboutsummaryrefslogtreecommitdiff
path: root/zsh/termsupport.zsh
blob: 6768222ec3dc85c0f389a8f8f45000e7f84c4454 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#done

case "$TERM" in
  xterm*|rxvt*)
    term_preexec () {
      print -Pn "\e]0;%n@%m:%~ ($1)\a"  # xterm
    }
    term_precmd () {
      print -Pn "\e]0;%n@%m:%~\a"  # xterm
    }
    ;;
  screen*)
    term_preexec () {
      local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]}
      echo -ne "\ek$CMD\e\\"
      print -Pn "\e]0;%n@%m:%~($1)\a"  # xterm
    }
    term_precmd () {
      echo -ne "\ekzsh\e\\"
      print -Pn "\e]0;%n@%m:%~\a"  # xterm
    }
    ;;
esac