Nicer error message if bash version < 4

macOS has bash 3
This commit is contained in:
Kovid Goyal 2022-03-04 20:59:22 +05:30
parent e990d233e5
commit c02d578468
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -53,7 +53,13 @@ _ksi_inject() {
} }
_ksi_inject _ksi_inject
builtin unset -f _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 # we have already run
builtin unset KITTY_SHELL_INTEGRATION builtin unset KITTY_SHELL_INTEGRATION
builtin return; builtin return;