about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-18T12·51+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-18T12·51+0200
commit4f4a14453ae8dbfc24a1e580aa695165e9d81f0a (patch)
tree593df0e0ae4ef94f0cd3e34f97e4eba10497b774
parent4ea034a5c56a60ae0ceedf18a066c428a963c836 (diff)
Don't set $PS1 in non-interactive shells
Shouldn't really matter, but you never know.
-rwxr-xr-xscripts/nix-build.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/nix-build.in b/scripts/nix-build.in
index 4bf85ae138d8..8ac95e90e59e 100755
--- a/scripts/nix-build.in
+++ b/scripts/nix-build.in
@@ -209,7 +209,7 @@ foreach my $expr (@exprs) {
             '[ -e $stdenv/setup ] && source $stdenv/setup; ' .
             ($pure ? '' : 'PATH=$PATH:$p; ') .
             'set +e; ' .
-            'PS1="\n\[\033[1;32m\][nix-shell:\w]$\[\033[0m\] "; ' .
+            '[ -n "$PS1" ] && PS1="\n\[\033[1;32m\][nix-shell:\w]$\[\033[0m\] "; ' .
             'unset NIX_ENFORCE_PURITY; ' .
             'shopt -u nullglob; ' .
             $envCommand);