fix(resurrect): target panes by immutable %id, not shifting indices#32
Open
MattKotsenas wants to merge 1 commit into
Open
fix(resurrect): target panes by immutable %id, not shifting indices#32MattKotsenas wants to merge 1 commit into
MattKotsenas wants to merge 1 commit into
Conversation
restore.ps1 relaunched processes with send-keys aimed at session:windowIndex.paneIndex strings, with the window index derived via list-windows piped to Select -Last 1. When indices shifted, send-keys/select-pane could land on the wrong pane.
Capture each pane's immutable %id at creation (new-session/new-window/split-window with -P -F #{pane_id}) and target every operation by id, keeping the index string as a per-pane fallback so a missed capture never breaks restore. Keeps the send-keys mechanism for tmux-resurrect parity.
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.
Problem
restore.ps1relaunches saved processes withsend-keysaimed at panes by index (derived fromlist-windows | Select -Last 1). When window/pane indices shift during restore,send-keys/select-panecould land on the wrong pane.Change
Capture each pane's immutable
%idat creation (with-P -F '#{pane_id}') and target every restore operation by that id. If a capture ever fails, the pane/window is skipped rather than mis-targeted.Also folds the per-pane restore operations into a single pass and drops two now-vestigial sleeps.
Notes
send-keysrelaunch mechanism for tmux-resurrect parity