1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-28 02:37:09 +00:00

bash: do not evaluate completions on dumb terminals

This commit is contained in:
Mario Rodas 2018-10-14 08:39:36 -05:00
parent b82bc64a0e
commit dff88ee954

View file

@ -75,17 +75,19 @@ in
${cfg.interactiveShellInit}
${optionalString cfg.enableCompletion ''
source "${pkgs.bash-completion}/etc/profile.d/bash_completion.sh"
if [ "$TERM" != "dumb" ]; then
source "${pkgs.bash-completion}/etc/profile.d/bash_completion.sh"
nullglobStatus=$(shopt -p nullglob)
shopt -s nullglob
for p in $NIX_PROFILES; do
for m in "$p/etc/bash_completion.d/"* "$p/share/bash-completion/completions/"*; do
source $m
nullglobStatus=$(shopt -p nullglob)
shopt -s nullglob
for p in $NIX_PROFILES; do
for m in "$p/etc/bash_completion.d/"* "$p/share/bash-completion/completions/"*; do
source $m
done
done
done
eval "$nullglobStatus"
unset nullglobStatus p m
eval "$nullglobStatus"
unset nullglobStatus p m
fi
''}
# Read system-wide modifications.