diff options
author | Pat Regan <thehead@patshead.com> | 2011-04-20 01:29:58 -0400 |
---|---|---|
committer | Pat Regan <thehead@patshead.com> | 2011-04-20 01:29:58 -0400 |
commit | 655e6e8df0aaba7da9a4a35a3c2017a9050fa99d (patch) | |
tree | 0eeaba5ff7b8453a7cc94cdc0ad2d9c1b951afbf /lib/termsupport.zsh | |
parent | 796f5164f306da2f4e6ab7cbadc17b78f5f683af (diff) | |
parent | 971b071dc67f423d8b2a6f476e1dd58819049f41 (diff) | |
download | zsh-655e6e8df0aaba7da9a4a35a3c2017a9050fa99d.tar.gz zsh-655e6e8df0aaba7da9a4a35a3c2017a9050fa99d.tar.bz2 zsh-655e6e8df0aaba7da9a4a35a3c2017a9050fa99d.zip |
Merge remote branch 'upstream/master'
Conflicts:
plugins/github/github.plugin.zsh
Diffstat (limited to 'lib/termsupport.zsh')
-rw-r--r-- | lib/termsupport.zsh | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index b250833ed..3152751e4 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -3,11 +3,12 @@ #Fully support screen, iterm, and probably most modern xterm and rxvt #Limited support for Apple Terminal (Terminal can't set window or tab separately) function title { - if [[ "$TERM" == "screen" ]]; then - print -Pn "\ek$1\e\\" #set screen hardstatus, usually truncated at 20 chars + [ "$DISABLE_AUTO_TITLE" != "true" ] || return + if [[ $TERM =~ "^screen" ]]; then + print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars elif [[ ($TERM =~ "^xterm") ]] || [[ ($TERM == "rxvt") ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then - print -Pn "\e]2;$2\a" #set window name - print -Pn "\e]1;$1\a" #set icon (=tab) name (will override window name on broken terminal) + print -Pn "\e]2;$2:q\a" #set window name + print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal) fi } @@ -16,15 +17,13 @@ ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~" #Appears when you have the prompt function precmd { - if [ "$DISABLE_AUTO_TITLE" != "true" ]; then - title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE - fi + title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE } #Appears at the beginning of (and during) of command execution function preexec { - if [ "$DISABLE_AUTO_TITLE" != "true" ]; then - local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd - title "$CMD" "%100>...>$2%<<" - fi + emulate -L zsh + setopt extended_glob + local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd + title "$CMD" "%100>...>$2%<<" } |