From ed7f046ee4dee89e5e8bbbecbc67ee14ac1f10d1 Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Tue, 15 Sep 2026 20:43:59 -0400 Subject: [PATCH] bash: recognize attributed prompt command arrays Bash includes additional variable attributes in declare output, so an exported indexed array is reported with an -ax prefix instead of -a. Match the indexed-array prefix without requiring a following space so these values continue through the array-preserving path. --- src/shell-integration/bash/ghostty.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shell-integration/bash/ghostty.bash b/src/shell-integration/bash/ghostty.bash index 48115da14..701e335c8 100644 --- a/src/shell-integration/bash/ghostty.bash +++ b/src/shell-integration/bash/ghostty.bash @@ -255,7 +255,7 @@ if (( BASH_VERSINFO[0] > 4 || (BASH_VERSINFO[0] == 4 && BASH_VERSINFO[1] >= 4) ) else PROMPT_COMMAND="__ghostty_hook 2>/dev/null" fi - elif [[ $(builtin declare -p PROMPT_COMMAND 2>/dev/null) == "declare -a "* ]]; then + elif [[ $(builtin declare -p PROMPT_COMMAND 2>/dev/null) == "declare -a"* ]]; then PROMPT_COMMAND+=("__ghostty_hook 2>/dev/null") else [[ "${PROMPT_COMMAND}" =~ (\;[[:space:]]*|$'\n')$ ]] || PROMPT_COMMAND+=";"