From 9dd5410433e8b3f46f7e41b3d846f2745c5ad586 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 14 Jan 2022 18:21:21 +0530 Subject: [PATCH] Dont rely on declare -g existing in bash --- shell-integration/bash/kitty.bash | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shell-integration/bash/kitty.bash b/shell-integration/bash/kitty.bash index 38843604a..13259f7eb 100644 --- a/shell-integration/bash/kitty.bash +++ b/shell-integration/bash/kitty.bash @@ -1,9 +1,12 @@ #!/bin/bash +# this is defined outside _ksi_main to make it global without using declare -g +# which is not available on older bash +declare -A _ksi_prompt=( [cursor]='y' [title]='y' [mark]='y' [complete]='y' [ps0]='' [ps1]='' [ps2]='' ) + _ksi_main() { if [[ $- != *i* ]] ; then return; fi # check in interactive mode if [[ -z "$KITTY_SHELL_INTEGRATION" ]]; then return; fi - declare -g -A _ksi_prompt=( [cursor]='y' [title]='y' [mark]='y' [complete]='y' [ps0]='' [ps1]='' [ps2]='' ) set -f for i in ${KITTY_SHELL_INTEGRATION[@]}; do set +f