0365ef0529ddfb912ca8202773e45916c55fdf4f

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #321 from nel/fix-window-title-regex.

Relax pattern matching on TERM. Closes #320.

Diff

 1diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
 2index 3152751e44b23f5b223eeb796e03a4fe08aff107..22e7f372fffdb1da78ffd3852130340a5d9aa448 100644
 3--- a/lib/termsupport.zsh
 4+++ b/lib/termsupport.zsh
 5@@ -4,9 +4,9 @@
 6 #Limited support for Apple Terminal (Terminal can't set window or tab separately)
 7 function title {
 8   [ "$DISABLE_AUTO_TITLE" != "true" ] || return
 9-  if [[ $TERM =~ "^screen" ]]; then 
10+  if [[ "$TERM" == screen* ]]; then 
11     print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
12-  elif [[ ($TERM =~ "^xterm") ]] || [[ ($TERM == "rxvt") ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
13+  elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
14     print -Pn "\e]2;$2:q\a" #set window name
15     print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal)
16   fi