Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/shell/bash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -38,7 +39,7 @@ impl Shell for Bash {
local command
command="${{1:-}}"
if [ "$#" = 0 ]; then
command '{exe}'
command {exe}
return
fi
shift
Expand All @@ -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() {{
Expand Down Expand Up @@ -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
Expand Down
Loading