mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-16 13:28:16 +00:00
Merge pull request #109 from marsam/feature/update-bashrc-config
Do not evaluate /etc/bashrc on non-interactive shells
This commit is contained in:
commit
e6a698a701
1 changed files with 18 additions and 12 deletions
|
@ -52,9 +52,6 @@ in
|
||||||
# /etc/bashrc: DO NOT EDIT -- this file has been generated automatically.
|
# /etc/bashrc: DO NOT EDIT -- this file has been generated automatically.
|
||||||
# This file is read for interactive shells.
|
# This file is read for interactive shells.
|
||||||
|
|
||||||
# Make bash check its window size after a process completes
|
|
||||||
shopt -s checkwinsize
|
|
||||||
|
|
||||||
[ -r "/etc/bashrc_$TERM_PROGRAM" ] && . "/etc/bashrc_$TERM_PROGRAM"
|
[ -r "/etc/bashrc_$TERM_PROGRAM" ] && . "/etc/bashrc_$TERM_PROGRAM"
|
||||||
|
|
||||||
# Only execute this file once per shell.
|
# Only execute this file once per shell.
|
||||||
|
@ -66,12 +63,20 @@ in
|
||||||
|
|
||||||
export PATH=${config.environment.systemPath}
|
export PATH=${config.environment.systemPath}
|
||||||
${config.system.build.setEnvironment.text}
|
${config.system.build.setEnvironment.text}
|
||||||
|
|
||||||
|
# Return early if not running interactively, but after basic nix setup.
|
||||||
|
[[ $- != *i* ]] && return
|
||||||
|
|
||||||
|
# Make bash check its window size after a process completes
|
||||||
|
shopt -s checkwinsize
|
||||||
|
|
||||||
${config.system.build.setAliases.text}
|
${config.system.build.setAliases.text}
|
||||||
|
|
||||||
${config.environment.interactiveShellInit}
|
${config.environment.interactiveShellInit}
|
||||||
${cfg.interactiveShellInit}
|
${cfg.interactiveShellInit}
|
||||||
|
|
||||||
${optionalString cfg.enableCompletion ''
|
${optionalString cfg.enableCompletion ''
|
||||||
|
if [ "$TERM" != "dumb" ]; then
|
||||||
source "${pkgs.bash-completion}/etc/profile.d/bash_completion.sh"
|
source "${pkgs.bash-completion}/etc/profile.d/bash_completion.sh"
|
||||||
|
|
||||||
nullglobStatus=$(shopt -p nullglob)
|
nullglobStatus=$(shopt -p nullglob)
|
||||||
|
@ -83,6 +88,7 @@ in
|
||||||
done
|
done
|
||||||
eval "$nullglobStatus"
|
eval "$nullglobStatus"
|
||||||
unset nullglobStatus p m
|
unset nullglobStatus p m
|
||||||
|
fi
|
||||||
''}
|
''}
|
||||||
|
|
||||||
# Read system-wide modifications.
|
# Read system-wide modifications.
|
||||||
|
|
Loading…
Add table
Reference in a new issue