From b4f45632debe6b8dc2f44ca6cc1b003d9093ad33 Mon Sep 17 00:00:00 2001 From: Igor Soarez Date: Fri, 23 Oct 2026 18:45:06 +0300 Subject: session groups: list each pane once, save each group once a pane in several sessions (a session group, `new-session -t`, or a linked window) was listed once per session: every agent of a group showed twice in the menu, panel, search, `dingger status`, and the counts. and snapshots saved each session of a group with its own copy of the windows, so restore would have rebuilt them twice and resumed each agent twice on one session file. - a pane keeps its first listing (tmux lists sessions by name) and is attended if the user looks at it through any session of the group. - snapshots keep the first session of each group; the others are not restored. e2e step 19 covers both; the previous binaries fail it. two checks (step 11's and this one) waited for idle after a turn that started from idle, which passed before the turn was even processed: they now wait for working first, and the negative control for group attendance fails as it should. step 18 now waits for the snapshot it later restores from. --- menubar/model.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'menubar') diff --git a/menubar/model.swift b/menubar/model.swift index a17b009..8bed858 100644 --- a/menubar/model.swift +++ b/menubar/model.swift @@ -228,9 +228,12 @@ func fetchRows() -> [Row] { "#{session_name}", "#{window_name}", "#{window_panes}", "#{pane_index}", "#{pane_current_path}", ].joined(separator: "\t") guard let out = tmux(["list-panes", "-a", "-F", format]) else { return [] } + // A pane in several sessions (a session group, a linked window) is + // listed once, under its first session, as the daemon counts it. + var listed = Set() let rows: [Row] = out.split(separator: "\n").compactMap { line in let f = line.split(separator: "\t", omittingEmptySubsequences: false).map(String.init) - guard f.count >= 10, !f[1].isEmpty else { return nil } + guard f.count >= 10, !f[1].isEmpty, listed.insert(f[0]).inserted else { return nil } let status = Status(rawValue: f[2]) ?? .unknown guard status != .unknown else { return nil } let window = (Int(f[7]) ?? 1) > 1 ? "\(f[6]).\(f[8])" : f[6] -- cgit v1.2.3