From: Daan De Meyer Date: Tue, 28 Jan 2025 20:09:11 +0000 (+0100) Subject: Treat terminal as dumb if either stdout or stderr is not a tty X-Git-Tag: v25.3~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81f1dac1cd0da666c2625c37912956f2979df709;p=thirdparty%2Fmkosi.git Treat terminal as dumb if either stdout or stderr is not a tty Fixes #3445 --- diff --git a/mkosi/sandbox.py b/mkosi/sandbox.py index f265963bb..9949e0ee5 100755 --- a/mkosi/sandbox.py +++ b/mkosi/sandbox.py @@ -101,10 +101,7 @@ libc.fcntl.argtypes = (ctypes.c_int, ctypes.c_int, ctypes.c_int) def terminal_is_dumb() -> bool: - if not sys.stdout.isatty() and not sys.stderr.isatty(): - return True - - return os.getenv("TERM", "") == "dumb" + return not sys.stdout.isatty() or not sys.stderr.isatty() or os.getenv("TERM", "") == "dumb" class Style: