d138751cbd721bf7036e88cb1a2bafc9ebb87366

Author
Renaud (Nel) Morvan <nel@w3fu.com>
Committer
Renaud (Nel) Morvan <nel@w3fu.com>
Date

Message

Escape characters used in escape sequence to avoid triggering bugs in Apple Terminal

Closes #45 #57 #58 #86.

Diff

 1diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
 2index b250833ed66c7d886cf68e1a26ab9ea0e1004b7e..494ef8923cbb7fad7e2429ff041c6d923e105e8d 100644
 3--- a/lib/termsupport.zsh
 4+++ b/lib/termsupport.zsh
 5@@ -4,10 +4,10 @@
 6 #Limited support for Apple Terminal (Terminal can't set window or tab separately)
 7 function title {
 8   if [[ "$TERM" == "screen" ]]; then 
 9-    print -Pn "\ek$1\e\\" #set screen hardstatus, usually truncated at 20 chars
10+    print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
11   elif [[ ($TERM =~ "^xterm") ]] || [[ ($TERM == "rxvt") ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
12-    print -Pn "\e]2;$2\a" #set window name
13-    print -Pn "\e]1;$1\a" #set icon (=tab) name (will override window name on broken terminal)
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
17 }
18