From b0fbe0d11ac60074b4fdc20e332bc2db3e0c0066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 12 Dec 2013 23:27:22 +0100 Subject: [PATCH 1/4] Avoid evaluating special chars in $LINE on title command (fixes #2234) --- lib/termsupport.zsh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 80319e1a8..6eba8f69a 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -27,9 +27,8 @@ function omz_termsupport_preexec { emulate -L zsh setopt extended_glob local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd - local LINE="${2:gs/$/\\$}" - LINE="${LINE:gs/%/%%}" - title "$CMD" "%100>...>$LINE%<<" + local LINE="${2}" + title "$CMD" '%100>...>$LINE%<<' } autoload -U add-zsh-hook From b73ced397fc74618d92f748e2744e65f901b368f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 14 Dec 2013 02:13:18 +0100 Subject: [PATCH 2/4] Use single quotes also in $LINE definiton --- lib/termsupport.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 6eba8f69a..d3d8c967f 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -27,7 +27,7 @@ function omz_termsupport_preexec { emulate -L zsh setopt extended_glob local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd - local LINE="${2}" + local LINE='${2}' title "$CMD" '%100>...>$LINE%<<' } From 3e5de21dc5b71e332a1526ae14beb662a66d6e26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 14 Dec 2013 04:30:29 +0100 Subject: [PATCH 3/4] Revert previous commit, escape % --- lib/termsupport.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index d3d8c967f..623bf1f09 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -27,7 +27,7 @@ function omz_termsupport_preexec { emulate -L zsh setopt extended_glob local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd - local LINE='${2}' + local LINE="${2:gs/%/%%}" title "$CMD" '%100>...>$LINE%<<' } From a951600b4e81d73d71a098e48aa8d296be853bc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 16 Dec 2013 09:24:24 +0100 Subject: [PATCH 4/4] Avoid 'title:parse error' with single quotes in $CMD Fixes #2182 --- lib/termsupport.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 623bf1f09..5f2fe63d4 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -28,7 +28,7 @@ function omz_termsupport_preexec { setopt extended_glob local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd local LINE="${2:gs/%/%%}" - title "$CMD" '%100>...>$LINE%<<' + title '$CMD' '%100>...>$LINE%<<' } autoload -U add-zsh-hook