From 969369d4b84fa1847dc3dee0e737dcd58e56c5e7 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 20 Nov 2026 01:46:17 -0300 Subject: attach: `pardes attach [NAME]` is a client always, from a terminal a terminal's and from `pardes-gui` a window's, whatever the session was born with (the ruling of 2026-11-17: a session's own frontend is only the one it was born with), and the in-place attach deleted with what only it used (305 lines deleted, 94 added): the daemon's `attach` request and its `find` that chose (runtime/daemon.zig), `daemon.attach` and its `Answer`, `Note.attach`, the stub's second use (`stubWait`'s `child` and its `r`/`x` words, `tellStubExit`), `attachTo`'s two hand-offs and `crossAttach` (runtime/main.zig: a named attach goes straight to the replica socket, where the daemon refuses a name nobody has; a bare one takes the one detached session, else the one session, from the daemon's `list`, else names them: `bareAttach`, with a test), the terminal handed to a session (`attachTerminal`, `refuse`, the `.attach` message and its three arms: dev/tui/tui.zig), the window opened again in place (`openTheWindow`, `Shell.detached`, the queue's `.window` and its arms: dev/gui/gui.zig, dev/Inbox.zig, runtime/macos.zig), and `setState(false)`, which nothing says now (`setDetached`); test/daemon.py's attach cases expect a client (a Detach in its own terminal once, then each attach a client in `--ps`, the session detached still, its Detach exit 1 "let this client go"; the window cycles as window clients, offscreen); tui shell-test 1046/1049 (3 skipped, as the base), core-test 855/1005 (the base's less the deleted `find` test), daemon.py plain passing (gated with the next change) Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- dev/Inbox.zig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'dev/Inbox.zig') diff --git a/dev/Inbox.zig b/dev/Inbox.zig index ed3a9835..4df02013 100644 --- a/dev/Inbox.zig +++ b/dev/Inbox.zig @@ -23,8 +23,6 @@ pub const Msg = union(enum) { kind_job: *KindJob, files_changed, fs_ready, - /// The daemon asks for the window again (`pardes-gui --attach`). - window, /// A shell a dead session left, its pty's master (Adopt); pid 0 is /// the last of them told. adopted: struct { pid: libc.pid_t, fd: c_int }, @@ -44,7 +42,7 @@ pub const Msg = union(enum) { .adopted => |a| if (a.fd >= 0) { _ = libc.close(a.fd); }, - .eof, .files_changed, .fs_ready, .window => {}, + .eof, .files_changed, .fs_ready => {}, } } }; -- cgit v1.3