summaryrefslogtreecommitdiff
path: root/lib/termsupport.zsh
diff options
context:
space:
mode:
authorEhren Kret <ehren.kret@gmail.com>2013-06-11 11:37:35 -0700
committerEhren Kret <ehren.kret@gmail.com>2013-06-11 11:37:35 -0700
commitab7604e5c2a4e07e656b3e4edf0d3e45407665e5 (patch)
treec0cee36034db8452d6c7a1e48a5afd121fcf7fcf /lib/termsupport.zsh
parent5d6a06bda64c59f94a9e7ef506d4523194a031b6 (diff)
downloadzsh-ab7604e5c2a4e07e656b3e4edf0d3e45407665e5.tar.gz
zsh-ab7604e5c2a4e07e656b3e4edf0d3e45407665e5.tar.bz2
zsh-ab7604e5c2a4e07e656b3e4edf0d3e45407665e5.zip
Escape both % and $ in the command line
Fixes issue #1884
Diffstat (limited to 'lib/termsupport.zsh')
-rw-r--r--lib/termsupport.zsh4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
index e3828da14..80319e1a8 100644
--- a/lib/termsupport.zsh
+++ b/lib/termsupport.zsh
@@ -27,7 +27,9 @@ 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
- title "$CMD" "%100>...>${2:gs/%/%%}%<<"
+ local LINE="${2:gs/$/\\$}"
+ LINE="${LINE:gs/%/%%}"
+ title "$CMD" "%100>...>$LINE%<<"
}
autoload -U add-zsh-hook