From 60911dbc02d62ff57edf8f172dada1bfc537c6e4 Mon Sep 17 00:00:00 2001 From: Dennis Kempin Date: Tue, 13 Sep 2022 20:27:08 +0000 Subject: [PATCH] dev_container: Always pass tty to docker if available This allows programs to use colors and other tty features. It also fixes issues with stdout being buffered instead of printed in real time. BUG=b:246623045 TEST=./tools/dev_container ./tools/health-check --all -v Change-Id: I09dd7523a15fbd8b3c5c653471ef091eac75cf6d Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3892522 Commit-Queue: Dennis Kempin Reviewed-by: Daniel Verkamp --- tools/dev_container | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/dev_container b/tools/dev_container index 1a7ff30d51..438a661962 100755 --- a/tools/dev_container +++ b/tools/dev_container @@ -170,6 +170,9 @@ def main( if not sys.stdin.isatty(): raise Exception("Trying to run an interactive session in a non-interactive terminal.") tty_args = ["--interactive", "--tty"] + elif sys.stdin.isatty(): + # Even if run non-interactively, we do want to pass along a tty for proper output. + tty_args = ["--tty"] # Start an interactive shell by default if hermetic: