From c78641fdbe931ca2e6e87eb3e001bd021c1eba3f Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 06:16:52 -0300 Subject: A pty/ctl winsize gives a terminal two rows at least, so it no longer reads busy for ever A one-row pty loses the prompt's input mark as soon as the prompt wraps, and busy detection never sees the shell idle again. Placement already keeps a new terminal at tag + 2 rows; a winsize write now keeps the pty at two. A pane dragged down to one body row keeps a one-row pty, since a taller pty than the pane shows would put its cursor below the pane. Co-Authored-By: Claude Opus 5.5 --- test/fs.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test') diff --git a/test/fs.py b/test/fs.py index 8d16d718..45fdbc38 100644 --- a/test/fs.py +++ b/test/fs.py @@ -435,6 +435,13 @@ def run_file(binary): assert run(client, term, b'fi\n') == b'error not run\n' # a syntax error runs nothing assert run(client, term, b"echo 'open\n") == b'error not run\n' # nor does an open quote assert run(client, term, b'true\n') == b'exit 0\n' # ...and the shell is clear after + # A pty asked for one row gets two: one loses the prompt's input + # mark, and the shell would read busy for ever. + client.write(f'/pane/{term}/pty/ctl', b'winsize 20 1\n') + time.sleep(.5) + assert run(client, term, b'true\n') == b'exit 0\n' + assert client.read(f'/pane/{term}/pty/ctl').split()[2] == b'2', client.read(f'/pane/{term}/pty/ctl') + client.write(f'/pane/{term}/pty/ctl', b'winsize 80 24\n') with Client(address) as other: slow = [] waiter = threading.Thread(target=lambda: slow.append(run(other, term, b'sleep 1\n')), daemon=True) -- cgit v1.3