about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2017-01-09T15·44+0100
committerGitHub <noreply@github.com>2017-01-09T15·44+0100
commitf61337fdb36fa7107b015d57eff399553e69e9a3 (patch)
tree51952fc35d2150fff30e41a7f10df6ab060565b4
parent9000150a784d05a76455886b1ad8a95e0cff2115 (diff)
parent3890de049dff68b85ddb1e21c91e16561bc668ce (diff)
Merge pull request #1177 from dezgeg/bash-env-breakage
nix-shell: Fix 'nix-shell --command' doing nothing without TTY
-rwxr-xr-xsrc/nix-build/nix-build.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nix-build/nix-build.cc b/src/nix-build/nix-build.cc
index c67148728722..71ef5af86af9 100755
--- a/src/nix-build/nix-build.cc
+++ b/src/nix-build/nix-build.cc
@@ -81,7 +81,8 @@ int main(int argc, char ** argv)
         auto pure = false;
         auto fromArgs = false;
         auto packages = false;
-        auto interactive = true;
+        // Same condition as bash uses for interactive shells
+        auto interactive = isatty(STDIN_FILENO) && isatty(STDERR_FILENO);
 
         Strings instArgs;
         Strings buildArgs;