From 94f6090603e9c9f611a01335bd4eca480b00db76 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 1 Oct 2026 08:44:40 -0300 Subject: `pardes --wait FILE` with $PARDES_9P set but no pane of its own (an agent's or a script's EDITOR) asks that session and waits there, not a screen of its own Forwarding asked for $PARDES_PID and $PARDES_PANE, which only a pane's shell has, so a client that talks to a session from outside its panes got a full editor drawn in its terminal. With --wait and $PARDES_9P alone, the file is looked at through the session's root look and the wait is for that pane's del. Co-Authored-By: Claude Opus 5.5 --- test/fs.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test') diff --git a/test/fs.py b/test/fs.py index 270ac367..11233e80 100644 --- a/test/fs.py +++ b/test/fs.py @@ -1397,6 +1397,22 @@ def test(binary, quic=False): assert time.monotonic() - deleted < .05, time.monotonic() - deleted assert second.wait(timeout=5) == 0 assert edited.read_bytes() == b'edited\n' + # --wait from outside the session's panes, $PARDES_9P alone (an + # agent's EDITOR): asked of the session, not a screen of its own. + outside_env = {k: v for k, v in env.items() if k not in ('PARDES_PANE', 'PARDES_PID')} + far = root / 'wait far.txt' + far.write_bytes(b'far\n') + before = serials() + waiting = subprocess.Popen([binary, '--wait', str(far)], cwd=root, env=outside_env, + stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE) + deadline = time.monotonic() + 5 + while not serials() - before and time.monotonic() < deadline: + time.sleep(.01) + far_pane, = serials() - before + time.sleep(.3) + assert waiting.poll() is None, waiting.stderr.read() + client.remove(f'/pane/{far_pane}') + assert waiting.wait(timeout=5) == 0 # `--` ends the options: a name starting with a dash is a name. dash = root / '-dash.txt' dash.write_bytes(b'dash\n') -- cgit v1.3