From c02d57846874df2350f09c2f4069d1df4b3c199a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 4 Mar 2022 20:59:22 +0530 Subject: [PATCH] Nicer error message if bash version < 4 macOS has bash 3 --- shell-integration/bash/kitty.bash | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/shell-integration/bash/kitty.bash b/shell-integration/bash/kitty.bash index dac4f1d81..427a205de 100644 --- a/shell-integration/bash/kitty.bash +++ b/shell-integration/bash/kitty.bash @@ -53,7 +53,13 @@ _ksi_inject() { } _ksi_inject builtin unset -f _ksi_inject -if [[ "$_ksi_prompt[sourced]" != "[sourced]" ]]; then + +if [ "${BASH_VERSINFO:-0}" -lt 4 ]; then + builtin printf "%s\n" "Bash version ${BASH_VERSION} too old, kitty shell integration disabled" > /dev/stderr; + builtin return; +fi + +if [[ "${_ksi_prompt[sourced]}" == "y" ]]; then # we have already run builtin unset KITTY_SHELL_INTEGRATION builtin return;