From 5f9b520ca09dd7cf90d3ce7286afdd05d350ae8d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 19 Mar 2023 21:05:29 +0530 Subject: [PATCH] Bash integration: Dont fail if the user enabled failglob in their bashrc BASH is by *far* the most buggy and least featureful of the three shells. Fix #6119 --- shell-integration/bash/kitty.bash | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shell-integration/bash/kitty.bash b/shell-integration/bash/kitty.bash index 5b5bf3a0f..835024581 100644 --- a/shell-integration/bash/kitty.bash +++ b/shell-integration/bash/kitty.bash @@ -245,7 +245,11 @@ _ksi_main() { if [[ -n "${_ksi_prompt[ps2]}" ]]; then _ksi_prompt[ps2]="${_ksi_prompt[start_mark]}${_ksi_prompt[ps2]}${_ksi_prompt[end_mark]}" fi + # BASH aborts the entire script when doing unset with failglob set, somebody should report this upstream + oldval=$(builtin shopt -p failglob) + builtin shopt -u failglob builtin unset _ksi_prompt[start_mark] _ksi_prompt[end_mark] _ksi_prompt[start_suffix_mark] _ksi_prompt[end_suffix_mark] _ksi_prompt[start_secondary_mark] _ksi_prompt[end_secondary_mark] + builtin eval "$oldval" # install our prompt command, using an array if it is unset or already an array, # otherwise append a string. We check if _ksi_prompt_command exists as some shell