From 6e3bacb1824463c30879516b10b5e6fd3017953a Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Fri, 22 May 2026 12:26:05 -0400 Subject: [PATCH] channel-tmux: resolve pane ids by label, don't persist them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tmux pane ids (%6 etc.) are ephemeral — recycled across pane and tmux-server restarts. The daemon persisted the id in tmux.json5 and kept reusing it, so after a restart a channel would attach to whatever unrelated pane had since inherited that id. (Live: ktest's stored %6 had become a claude pane; the real ktest pane was %10.) Persist only the label — the pane title / window name, which is stable. pipe_pane_reader() is now a connect-retry loop: each attempt, connect_and_stream() resolves the live id with find_pane_by_name(); the loop retries until the pane exists and pipe-pane succeeds, and reconnects the same way if the pipe later drops. send() resolves the id at send time; open() just registers the label and lets the reader find it. Co-Authored-By: Proof of Concept --- channels/tmux/src/main.rs | 182 ++++++++++++++++++++++---------------- 1 file changed, 104 insertions(+), 78 deletions(-) diff --git a/channels/tmux/src/main.rs b/channels/tmux/src/main.rs index f49bdc1..aecb3bd 100644 --- a/channels/tmux/src/main.rs +++ b/channels/tmux/src/main.rs @@ -26,10 +26,12 @@ use consciousness::thalamus::channel_log::ChannelLog; #[derive(Clone, serde::Serialize, serde::Deserialize)] struct PaneConfig { - /// Human-readable label, becomes the channel name "tmux.