mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-06-16 11:36:16 +08:00
fix(sudo): modify grep command to handle special characters in editorcmd
This commit is contained in:
parent
3604dc23e0
commit
cc9b75ace7
@ -78,7 +78,7 @@ sudo-command-line() {
|
||||
# - $realcmd is "cmd" and $EDITOR is /alternative/path/to/cmd that appears in $PATH
|
||||
if [[ "$realcmd" = (\$EDITOR|$editorcmd|${editorcmd:c}) \
|
||||
|| "${realcmd:c}" = ($editorcmd|${editorcmd:c}) ]] \
|
||||
|| builtin which -a "$realcmd" | command grep -Fx -q "$editorcmd"; then
|
||||
|| builtin which -a "$realcmd" | command grep -Fx -q -- "$editorcmd"; then
|
||||
__sudo-replace-buffer "$cmd" "sudo -e"
|
||||
return
|
||||
fi
|
||||
|
||||
Loading…
Reference in New Issue
Block a user