Browse code

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

Relax pattern matching on TERM. Closes #320.

Robby Russell authored on 02/05/2011 at 11:56:59
Showing 1 changed files
... ...
@@ -4,9 +4,9 @@
4 4
 #Limited support for Apple Terminal (Terminal can't set window or tab separately)
5 5
 function title {
6 6
   [ "$DISABLE_AUTO_TITLE" != "true" ] || return
7
-  if [[ $TERM =~ "^screen" ]]; then 
7
+  if [[ "$TERM" == screen* ]]; then 
8 8
     print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
9
-  elif [[ ($TERM =~ "^xterm") ]] || [[ ($TERM == "rxvt") ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
9
+  elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
10 10
     print -Pn "\e]2;$2:q\a" #set window name
11 11
     print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal)
12 12
   fi