From c6507f8b8dcf891cb90fcfc76d813b1d90ae2093 Mon Sep 17 00:00:00 2001 From: Dongge Liu Date: Wed, 5 Jul 2023 11:30:22 +1000 Subject: [PATCH] disable ANSI color in the output of `build_fuzzers` when stdin's file descripter is not a terminal (#10632) For example, ANSI colors will not be used when `stdin` is mapped to `DEVNULL`. --- infra/helper.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/infra/helper.py b/infra/helper.py index fc75bcd51..89ca202e5 100755 --- a/infra/helper.py +++ b/infra/helper.py @@ -833,9 +833,11 @@ def build_fuzzers_impl( # pylint: disable=too-many-arguments,too-many-locals,to ] command += [ - '-v', f'{project_out}:/out', '-v', f'{project.work}:/work', '-t', + '-v', f'{project_out}:/out', '-v', f'{project.work}:/work', f'gcr.io/oss-fuzz/{project.name}' ] + if sys.stdin.isatty(): + command.insert(-1, '-t') result = docker_run(command, architecture=architecture) if not result: