diff --git a/tools/dev_container b/tools/dev_container index 81e7368aef..c846661176 100755 --- a/tools/dev_container +++ b/tools/dev_container @@ -199,7 +199,6 @@ def main( stop: bool = False, clean: bool = False, hermetic: bool = False, - interactive: bool = False, use_docker: bool = False, self_test: bool = False, pull: bool = False, @@ -268,13 +267,10 @@ def main( docker("pull", f"gcr.io/crosvm-infra/crosvm_dev:{DEV_IMAGE_VERSION}").fg() return - # If a command is provided run non-interactive unless explicitly asked for. - tty_args = [] - if not command or interactive: - if not sys.stdin.isatty(): - raise Exception("Trying to run an interactive session in a non-interactive terminal.") + # Default to interactive mode if a tty is present. + if sys.stdin.isatty(): tty_args = ["--interactive", "--tty"] - elif sys.stdin.isatty(): + else: # Even if run non-interactively, we do want to pass along a tty for proper output. tty_args = ["--tty"]