ab7604e5c2a4e07e656b3e4edf0d3e45407665e5

Author
Ehren Kret <ehren.kret@gmail.com>
Committer
Ehren Kret <ehren.kret@gmail.com>
Date

Message

Escape both % and $ in the command line

Fixes issue #1884

Diff

 1diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
 2index e3828da1435b053f6f51b5f9e80e938b83f5348a..80319e1a86966b4a763c9b6a4209607a99b7a4b1 100644
 3--- a/lib/termsupport.zsh
 4+++ b/lib/termsupport.zsh
 5@@ -27,7 +27,9 @@ function omz_termsupport_preexec {
 6   emulate -L zsh
 7   setopt extended_glob
 8   local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
 9-  title "$CMD" "%100>...>${2:gs/%/%%}%<<"
10+  local LINE="${2:gs/$/\\$}"
11+  LINE="${LINE:gs/%/%%}"
12+  title "$CMD" "%100>...>$LINE%<<"
13 }
14 
15 autoload -U add-zsh-hook