1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2024-12-14 11:57:55 +00:00

bash: fix bashrcExtra interactive shell test

To determine if bash is running interactively test whether "$-"
contains "i".

See: https://www.gnu.org/software/bash/manual/html_node/Is-this-Shell-Interactive_003f.html
This commit is contained in:
Mario Rodas 2018-09-25 16:44:38 -05:00 committed by Robert Helgesson
parent 6957911657
commit a1a7e7cd24
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -155,7 +155,7 @@ in
in mkIf cfg.enable {
programs.bash.bashrcExtra = ''
# Commands that should be applied only for interactive shells.
if [[ -n $PS1 ]]; then
if [[ $- == *i* ]]; then
${historyControlStr}
${shoptsStr}