Skip to content

Commit

Permalink
Treat terminal as dumb if either stdout or stderr is not a tty
Browse files Browse the repository at this point in the history
Fixes #3445
  • Loading branch information
DaanDeMeyer committed Jan 29, 2025
1 parent 0b9ba06 commit 81f1dac
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions mkosi/sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,7 @@ class cap_user_data_t(ctypes.Structure):


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:
Expand Down

0 comments on commit 81f1dac

Please sign in to comment.