fix(bashrc): Stop manually re-sourcing system bash completion

The removed loop tried to source /etc/bash*completion and
/etc/profile.d/bash*completion* by hand, with two real problems:
nullglob wasn't enabled for it (unlike everywhere else via
_source_dir_files), so an empty match sourced the literal glob
pattern and errored — the TODO already flagged this. It also
re-sourced /etc/profile.d/bash_completion.sh, a script meant for
/etc/profile on login shells, not for being re-run from an
interactive-only ~/.bashrc.

On a properly packaged system, bash-completion wires itself up
already (confirmed here via /etc/profile.d/bash_completion.sh and
progcomp being on by default) — this loop was dead weight at best and
a source of environment-dependent breakage at worst (seen previously
on Termux, where /etc doesn't have the same layout).
This commit is contained in:
2026-08-22 02:03:17 +02:00
parent 6e01d0308e
commit a92c1c340f
+4 -2
View File
@@ -79,8 +79,10 @@ _source_dir_files "${BASH_CONFIG_DIR}"/aliases
_source_dir_files "${BASH_CONFIG_DIR}"/aliases.d _source_dir_files "${BASH_CONFIG_DIR}"/aliases.d
# Source bash completion definitions # Source bash completion definitions
# TODO: Améliorer cette partie pour éviter les erreurs quand aucun fichier n'existe # System-wide bash completion (bash-completion package) is expected to
for file in /etc/bash*completion /etc/profile.d/bash*completion*; do source "${file}"; done # already be wired by the distro itself, typically via
# /etc/profile.d/bash_completion.sh for login shells and the package's
# own non-login hook — no need to re-source it manually here.
_source_file_if_exists ~/.bash_completion _source_file_if_exists ~/.bash_completion
_source_file_if_exists "${BASH_CONFIG_DIR}"/completion _source_file_if_exists "${BASH_CONFIG_DIR}"/completion