mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-28 04:13:44 +00:00
Fix stdout line_buffering incorrect when parent kitty instance has its stdout redirected to a file
This commit is contained in:
parent
784daa1a4b
commit
9b1c23987c
1 changed files with 2 additions and 0 deletions
|
|
@ -828,6 +828,8 @@ def exec_main(stdin_read: int, stdout_write: int, death_notify_write: int, unix_
|
|||
if unix_socket is None:
|
||||
unix_socket = random_unix_socket()
|
||||
os.write(stdout_write, f'{get_socket_name(unix_socket)}\n'.encode('utf-8'))
|
||||
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
|
||||
try:
|
||||
main(stdin_read, stdout_write, death_notify_write, unix_socket)
|
||||
finally:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue