summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-01 08:44:40 -0300
committerGabriel Schneider <[email protected]>2026-10-01 08:53:11 -0300
commit94f6090603e9c9f611a01335bd4eca480b00db76 (patch)
tree79a9ab45a95b1d053964042ea2ee7b1db7dc4098 /test
parent9fddd372ed88886bf98e5c9d5ca88cee9a272357 (diff)
downloadpardes-94f6090603e9c9f611a01335bd4eca480b00db76.tar.gz
pardes-94f6090603e9c9f611a01335bd4eca480b00db76.zip
`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 <[email protected]>
Diffstat (limited to 'test')
-rw-r--r--test/fs.py16
1 files changed, 16 insertions, 0 deletions
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')