From 644e46e91dae86c3120a73624e9bb1439b7914f4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 30 Aug 2022 16:22:59 +0530 Subject: [PATCH] Reconfigure all stdio streams in the prefork process --- kitty/prewarm.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kitty/prewarm.py b/kitty/prewarm.py index d6b6bba65..8ce3543bd 100644 --- a/kitty/prewarm.py +++ b/kitty/prewarm.py @@ -567,8 +567,9 @@ def exec_main(stdin_read: int, stdout_write: int, death_notify_write: int) -> No os.set_inheritable(stdout_write, False) os.set_inheritable(death_notify_write, False) running_in_kitty(False) - if not sys.stdout.line_buffering: # happens if the parent kitty instance has stdout not pointing to a terminal - sys.stdout.reconfigure(line_buffering=True) # type: ignore + for x in (sys.stdout, sys.stdin, sys.stderr): + if not x.line_buffering: # happens if the parent kitty instance has stdout not pointing to a terminal + x.reconfigure(line_buffering=True) # type: ignore try: main(stdin_read, stdout_write, death_notify_write) finally: