diff --git a/src/shell/bash.rs b/src/shell/bash.rs index 953fec766c..73a5d86abd 100644 --- a/src/shell/bash.rs +++ b/src/shell/bash.rs @@ -19,6 +19,7 @@ impl Shell for Bash { let settings = Settings::get(); let exe = exe.to_string_lossy(); + let exe = shell_escape::unix::escape(exe); let mut out = String::new(); @@ -38,7 +39,7 @@ impl Shell for Bash { local command command="${{1:-}}" if [ "$#" = 0 ]; then - command '{exe}' + command {exe} return fi shift @@ -47,12 +48,12 @@ impl Shell for Bash { deactivate|shell|sh) # if argv doesn't contains -h,--help if [[ ! " $@ " =~ " --help " ]] && [[ ! " $@ " =~ " -h " ]]; then - eval "$(command '{exe}' "$command" "$@")" + eval "$(command {exe} "$command" "$@")" return $? fi ;; esac - command '{exe}' "$command" "$@" + command {exe} "$command" "$@" }} _mise_hook() {{ @@ -85,7 +86,7 @@ impl Shell for Bash { fi command_not_found_handle() {{ - if [[ "$1" != "mise" && "$1" != "mise-"* ]] && '{exe}' hook-not-found -s bash -- "$1"; then + if [[ "$1" != "mise" && "$1" != "mise-"* ]] && {exe} hook-not-found -s bash -- "$1"; then _mise_hook "$@" elif [ -n "$(declare -f _command_not_found_handle)" ]; then