From 15bd47670102ceae36565ee299fd8a40625c3b21 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sat, 31 Oct 2026 21:12:16 -0300 Subject: daemon: --attach= 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 ` (a named one, or with none of the client's kind the one session there is) and the client goes on as --attach=:; --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 --- test/daemon.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'test/daemon.py') 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 -- cgit v1.3