diff --git a/src/subcommand/init/shell/bash.rs b/src/subcommand/init/shell/bash.rs index 3304db2..fcd927a 100644 --- a/src/subcommand/init/shell/bash.rs +++ b/src/subcommand/init/shell/bash.rs @@ -20,7 +20,7 @@ _zoxide_hook() { case "$PROMPT_COMMAND" in *_zoxide_hook*) ;; - *) PROMPT_COMMAND="_zoxide_hook${PROMPT_COMMAND:+;${PROMPT_COMMAND}}" ;; + *) PROMPT_COMMAND="${PROMPT_COMMAND:+${PROMPT_COMMAND};}_zoxide_hook" ;; esac "#; diff --git a/src/subcommand/init/shell/posix.rs b/src/subcommand/init/shell/posix.rs index 631be21..6058af7 100644 --- a/src/subcommand/init/shell/posix.rs +++ b/src/subcommand/init/shell/posix.rs @@ -73,7 +73,7 @@ _zoxide_hook() { case "$PS1" in *\$\(_zoxide_hook\)*) ;; - *) PS1="\$(_zoxide_hook)${PS1}" ;; + *) PS1="${PS1}\$(_zoxide_hook)" ;; esac "#; @@ -123,7 +123,7 @@ _zoxide_hook() {{ case "$PS1" in *\$\(_zoxide_hook\)*) ;; - *) PS1="\$(_zoxide_hook)${{PS1}}" ;; + *) PS1="${{PS1}}\$(_zoxide_hook)" ;; esac"#, quote(tmp_path_str), quote(pwd_path_str),