summaryrefslogtreecommitdiff
path: root/test/daemon.py
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-31 21:12:16 -0300
committerGabriel Schneider <[email protected]>2026-10-31 21:18:38 -0300
commit15bd47670102ceae36565ee299fd8a40625c3b21 (patch)
treed0b04868f755c597b9fc83be52346be07583f1cc /test/daemon.py
parent4c761893e5b3fdae422622cfa02104ab36633045 (diff)
downloadpardes-15bd47670102ceae36565ee299fd8a40625c3b21.tar.gz
pardes-15bd47670102ceae36565ee299fd8a40625c3b21.zip
daemon: --attach=<name> to a session of the other kind (pardes in a terminal for a window's session, pardes-gui for a terminal's) joins it as a replica client through this machine's pardes-replica.sock, where it was refused in words; the daemon answers `other <name>` (a named one, or with none of the client's kind the one session there is) and the client goes on as --attach=<sock>:<name>; --help says attach takes an attached session too; test/daemon.py's window test attaches a terminal to the window session by name (the old build refused it, 'is a window')
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test/daemon.py')
-rw-r--r--test/daemon.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/test/daemon.py b/test/daemon.py
index bf575fd7..2c2ee318 100644
--- a/test/daemon.py
+++ b/test/daemon.py
@@ -1288,16 +1288,20 @@ def gui(binary, cycles):
assert not sized(client), 'the first window stays'
assert proc.poll() is None
print('daemon: a second window on an attached window session, detached alone')
- # Another kind is refused in words, and so is a name nobody has.
+ # Another kind joins as a replica client: a terminal of the window's
+ # session, by its name alone. A name nobody has is refused in words.
client.write(f'/pane/{shell}/exec', b'Detach\n')
wait_for('the window closed', lambda: sized(client))
term = Term()
tty_attach = term.spawn([binary.replace('pardes-gui', 'pardes'), '--attach=win'], env)
- assert tty_attach.wait(timeout=10) == 1
- wait_for('the refusal in the terminal', lambda: b'is a window' in term.text())
- said = term.text()
+ wait_for('the window session drawn in the terminal', lambda: b'\x1b[?1049h' in term.text())
+ time.sleep(1)
+ assert tty_attach.poll() is None, term.text()[-400:]
+ tty_attach.terminate()
+ tty_attach.wait(timeout=10)
term.close()
- assert b'is a window' in said, said
+ assert proc.poll() is None
+ print('daemon: a terminal attached to a window session by name, as a client')
nobody = subprocess.run([binary, '--attach=nobody'], env=env, cwd=root, timeout=10,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
assert nobody.returncode == 1 and b"no session called 'nobody'" in nobody.stderr, nobody.stderr