Flush stdout before killpg so terminal restore codes survive
sys.stdout is line-buffered on a tty, and fill3's terminal restore context managers (alternate_buffer, mouse_tracking, title) only write escape sequences without newlines. killpg(SIGKILL) killed the process before those buffered codes were flushed, leaving the terminal stuck in the alternate buffer with mouse tracking on. Flush first.
This commit is contained in:
parent
36a07813e7
commit
53474b2bcb
1 changed files with 1 additions and 0 deletions
|
|
@ -1081,6 +1081,7 @@ async def main(title, root_path, worker_count=None, editor_command=None, theme=N
|
|||
screen.save()
|
||||
if sys.stdout.isatty() and (os.getpgrp() == os.getpid()
|
||||
or os.getpgrp() == os.getppid()):
|
||||
sys.stdout.flush()
|
||||
os.killpg(os.getpgrp(), signal.SIGKILL)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue