From a92c1c340f11a5e044f91c766430b31910a05fde Mon Sep 17 00:00:00 2001 From: Xavier Logerais Date: Sat, 22 Aug 2026 02:03:17 +0200 Subject: [PATCH] fix(bashrc): Stop manually re-sourcing system bash completion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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). --- bashrc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bashrc b/bashrc index 96d5a05..58e4b1b 100644 --- a/bashrc +++ b/bashrc @@ -79,8 +79,10 @@ _source_dir_files "${BASH_CONFIG_DIR}"/aliases _source_dir_files "${BASH_CONFIG_DIR}"/aliases.d # Source bash completion definitions -# TODO: Améliorer cette partie pour éviter les erreurs quand aucun fichier n'existe -for file in /etc/bash*completion /etc/profile.d/bash*completion*; do source "${file}"; done +# System-wide bash completion (bash-completion package) is expected to +# 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_CONFIG_DIR}"/completion