Skip to content

Commit

Permalink
_main.py: Protect PTY mode from non-TTY stdin
Browse files Browse the repository at this point in the history
  • Loading branch information
hartwork committed Dec 16, 2023
1 parent 97a7272 commit 0ffe6a9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sandwine/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,11 @@ def main():
argv_builder.announce_to(sys.stderr)

argv = list(argv_builder.iter_flat())
with_pty = config.with_pty and os.isatty(sys.stdin.fileno())

with x11context:
try:
exit_code = spawn_argv(argv, with_pty=config.with_pty)
exit_code = spawn_argv(argv, with_pty=with_pty)
except FileNotFoundError:
_logger.error(f'Command {argv[0]!r} is not available, aborting.')
exit_code = 127
Expand Down

0 comments on commit 0ffe6a9

Please sign in to comment.