Skip to content

Commit

Permalink
Escape both % and $ in the command line
Browse files Browse the repository at this point in the history
Fixes issue ohmyzsh#1884
  • Loading branch information
ehrenkret authored and Drarok committed Sep 23, 2013
1 parent 80b7396 commit bc3346a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/termsupport.zsh
Expand Up @@ -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
Expand Down

0 comments on commit bc3346a

Please sign in to comment.