Skip to content

fix(terminal): paste into the session the pty client is attached to#166

Open
0x79H wants to merge 1 commit into
gbasin:masterfrom
0x79H:fix/pty-paste-target
Open

fix(terminal): paste into the session the pty client is attached to#166
0x79H wants to merge 1 commit into
gbasin:masterfrom
0x79H:fix/pty-paste-target

Conversation

@0x79H

@0x79H 0x79H commented Jul 22, 2026

Copy link
Copy Markdown

Fixes #162.

What

paste() targeted the grouped ws session unconditionally; after switching into an externally-discovered session the buffer landed in the ws session's own bootstrap window and the paste was silently lost (verified against master's exact command sequence — see the issue). The proxy now records lastEffectiveSession from the verified switch identity and pastes into that session's active pane, falling back to the ws session before the first switch (reset on dispose). Session-level targeting also keeps following manual prefix+n window changes made inside the terminal.

Verification

  • Container (Debian trixie, tmux 3.5a, non-root, HOSTNAME=127.0.0.1): full suite including the real-tmux layer — green; coverage mode and build pass.
  • The paste-into-bootstrap-pane behavior was reproduced with master's literal command sequence on an isolated tmux socket (probe text: 1 hit in the hidden bootstrap pane, 0 hits in the on-screen window); with the fix the probe lands on screen.

Tiny fix — feel free to fold it into anything else or rework as you prefer.

- paste() targeted the grouped ws session unconditionally; after
  switching into an externally-discovered session the buffer landed
  in the ws session's bootstrap window and the paste was lost
- track lastEffectiveSession from the verified switch identity and
  paste into that session's active pane, falling back to the ws
  session before the first switch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PTY mode: paste is delivered to the grouped ws session's bootstrap pane, not the window on screen

1 participant