fix(tmux): deduplicate panes to prevent "duplicate session id" crash#297
Open
seflue wants to merge 1 commit intofolke:mainfrom
Open
fix(tmux): deduplicate panes to prevent "duplicate session id" crash#297seflue wants to merge 1 commit intofolke:mainfrom
seflue wants to merge 1 commit intofolke:mainfrom
Conversation
`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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes a crash when a tmux window exists in multiple sessions
(e.g. via
link-windowor session groups).tmux list-panes -areturns one entry per session-pane combination,so a linked pane appears multiple times with the same
pane_pid.Since
skidis derived frompane_pid, this produces duplicate IDsthat fail the assert in
session/init.lua:142.The fix deduplicates panes by their tmux
pane_id(e.g.%5) inM.panes(). This ID is globally unique per physical pane. Linkedwindows share it, so the first occurrence wins. No behavior change
when windows are not linked.
Related Issue(s)
Screenshots
Crash fix, no UI change.