b88b5b2ed6923344b7a79ebbeea3822b0b502f3f

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #1885 from eakret/termsupport-fix

Escape both % and $ in the command line

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