mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +01:00
Deleted unnecessary space
This commit is contained in:
parent
1e6079ca66
commit
e77c31edc7
1 changed files with 8 additions and 5 deletions
|
|
@ -27,8 +27,7 @@ function omz_termsupport_preexec {
|
||||||
emulate -L zsh
|
emulate -L zsh
|
||||||
setopt extended_glob
|
setopt extended_glob
|
||||||
local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
|
local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
|
||||||
CMD=${CMD:gs/\\/\\\\} # escapses \ -- must be first
|
local LINE=${2}
|
||||||
local LINE=${2:gs/\\/\\\\} # escapes \ -- must be first
|
|
||||||
|
|
||||||
if [[ -o PROMPT_BANG ]]; then
|
if [[ -o PROMPT_BANG ]]; then
|
||||||
# We must escape ! so that it is not interpreted as a history event number
|
# We must escape ! so that it is not interpreted as a history event number
|
||||||
|
|
@ -37,10 +36,14 @@ function omz_termsupport_preexec {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -o PROMPT_SUBST ]]; then
|
if [[ -o PROMPT_SUBST ]]; then
|
||||||
# We must escape $ and `, as both initiate command substitution and
|
# We must escape '\', '$', and '`'
|
||||||
# the former also initiates arithmetic and parameter expansion
|
# The backslash is the escape character, and so must be escaped first.
|
||||||
|
# Both '$' and '`' initiate command substitution, and
|
||||||
|
# the former initiates arithmetic and parameter expansion
|
||||||
|
CMD=${CMD:gs/\\/\\\\} # escapses \ -- must be first
|
||||||
CMD=${CMD:gs/$/\\$}
|
CMD=${CMD:gs/$/\\$}
|
||||||
CMD=${CMD:gs/\`/\\\`}
|
CMD=${CMD:gs/\`/\\\`}
|
||||||
|
local LINE=${LINE:gs/\\/\\\\} # escapes \ -- must be first
|
||||||
LINE=${LINE:gs/$/\\$}
|
LINE=${LINE:gs/$/\\$}
|
||||||
LINE=${LINE:gs/\`/\\\`}
|
LINE=${LINE:gs/\`/\\\`}
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue