Bash shell integration: Fix yet another inconsistent use of SYS_BASHRC

Why Linux distros are constitutionally incapable of using consistent
names and values for anything is beyond me.

Fixes #4934
Fixes #4935
This commit is contained in:
Kovid Goyal 2022-04-07 17:54:52 +05:30
parent e66c732b41
commit d0398dca28
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -39,8 +39,10 @@ _ksi_inject() {
if [[ "$kitty_bash_inject" != *"no-rc"* ]]; then
# Linux distros build bash with -DSYS_BASHRC. Unfortunately, there is
# no way to to probe bash for it and different distros use different files
_ksi_safe_source "$KITTY_BASH_ETC_LOCATION/bash.bashrc" # Arch, Debian, Ubuntu
# Arch, Debian, Ubuntu use /etc/bash.bashrc
# Fedora uses /etc/bashrc sourced from ~/.bashrc instead of SYS_BASHRC
# Void Linux uses /etc/bash/bashrc
_ksi_safe_source "$KITTY_BASH_ETC_LOCATION/bash.bashrc" || _ksi_safe_source "$KITTY_BASH_ETC_LOCATION/bash/bashrc"
if [[ -z "$KITTY_BASH_RCFILE" ]]; then KITTY_BASH_RCFILE="$HOME/.bashrc"; fi
_ksi_safe_source "$KITTY_BASH_RCFILE"
fi