From a1a7e7cd249da03844601b9163d58dd496fb7d95 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Tue, 25 Sep 2018 16:44:38 -0500 Subject: [PATCH] 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 --- modules/programs/bash.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/bash.nix b/modules/programs/bash.nix index d8359c12f..14a158a24 100644 --- a/modules/programs/bash.nix +++ b/modules/programs/bash.nix @@ -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}