Skip to content

fix(tmux): deduplicate panes to prevent "duplicate session id" crash#297

Open
seflue wants to merge 1 commit intofolke:mainfrom
seflue:fix/tmux-duplicate-pane-id
Open

fix(tmux): deduplicate panes to prevent "duplicate session id" crash#297
seflue wants to merge 1 commit intofolke:mainfrom
seflue:fix/tmux-duplicate-pane-id

Conversation

@seflue
Copy link
Copy Markdown

@seflue seflue commented Apr 12, 2026

Description

Fixes a crash when a tmux window exists in multiple sessions
(e.g. via link-window or session groups).

tmux list-panes -a returns one entry per session-pane combination,
so a linked pane appears multiple times with the same pane_pid.
Since skid is derived from pane_pid, this produces duplicate IDs
that fail the assert in session/init.lua:142.

The fix deduplicates panes by their tmux pane_id (e.g. %5) in
M.panes(). This ID is globally unique per physical pane. Linked
windows share it, so the first occurrence wins. No behavior change
when windows are not linked.

Related Issue(s)

Screenshots

Crash fix, no UI change.

`tmux list-panes -a` returns one entry per session-pane combination.
When a pane exists in multiple sessions (via link-window or session
groups), M.panes() produced duplicate entries because the same
physical pane appears multiple times. Since skid is derived from
pane_pid, this triggers the assert in session/init.lua:142.

Skip already-seen pane_id values so each physical pane is returned
only once.
@github-actions github-actions bot added the size/s Small PR (<10 lines changed) label Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s Small PR (<10 lines changed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: "duplicate session id" crash when a tmux pane exists in multiple sessions

1 participant