aboutsummaryrefslogtreecommitdiff
path: root/menubar
diff options
context:
space:
mode:
authorIgor Soarez <igor@soarez.org>2026-10-23 18:45:06 +0300
committerIgor Soarez <igor@soarez.org>2026-10-23 18:45:06 +0300
commitb4f45632debe6b8dc2f44ca6cc1b003d9093ad33 (patch)
tree550add91d02656156330f497d60fe0e6bdf2fc35 /menubar
parent12ce9f3f8edc84064458b649e8615247641dad36 (diff)
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.
Diffstat (limited to 'menubar')
-rw-r--r--menubar/model.swift5
1 files changed, 4 insertions, 1 deletions
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<String>()
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]