]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Treat terminal as dumb if either stdout or stderr is not a tty
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 28 Jan 2025 20:09:11 +0000 (21:09 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 29 Jan 2025 09:44:41 +0000 (10:44 +0100)
Fixes #3445

mkosi/sandbox.py

index f265963bbb6abe87a9ff92ca1a1858782ae972f1..9949e0ee5719e9ba44418fe1373a7470274bcf12 100755 (executable)
@@ -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: