From be295512bb405b12a0008852ff74e36135700186 Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Sun, 10 Sep 2017 21:19:49 -0400 Subject: _sandboxbwrap.py: Make terminal control setting conditional on stdin being a tty So that interactive sandbox mode can be used in a test or automated scenario. --- buildstream/_sandboxbwrap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'buildstream/_sandboxbwrap.py') diff --git a/buildstream/_sandboxbwrap.py b/buildstream/_sandboxbwrap.py index 11bbdc58b..af9cd51d6 100644 --- a/buildstream/_sandboxbwrap.py +++ b/buildstream/_sandboxbwrap.py @@ -387,7 +387,7 @@ class SandboxBwrap(Sandbox): process.communicate() exit_code = process.poll() - if interactive: + if interactive and stdin.isatty(): # Make this process the foreground process again, otherwise the # next read() on stdin will trigger SIGTTIN and stop the process. # This is required because the sandboxed process does not have -- cgit v1.2.1