From 06f5a8e68410087a28f783ef8611f269275d0ab3 Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Wed, 21 Jul 2021 23:22:57 +0530 Subject: [PATCH] Remove preceding semicolon in PROMPT_COMMAND --- templates/bash.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/bash.txt b/templates/bash.txt index 9a11b5f..b805e4f 100644 --- a/templates/bash.txt +++ b/templates/bash.txt @@ -65,7 +65,11 @@ if [ "${__zoxide_hooked}" != '1' ]; then {%- if hook == InitHook::None %} {{ not_configured }} {%- else %} - PROMPT_COMMAND="__zoxide_hook;${PROMPT_COMMAND:+${PROMPT_COMMAND}}" + if [ -z "${PROMPT_COMMAND}" ]; then + PROMPT_COMMAND='__zoxide_hook' + else + PROMPT_COMMAND="__zoxide_hook;${PROMPT_COMMAND#;}" + fi {%- endif %} fi