Skip to content

fix(tui2): copy transcript selection outside viewport#8449

Merged
joshka-oai merged 1 commit intomainfrom
joshka/tui2-copy-offscreen-lines
Dec 22, 2025
Merged

fix(tui2): copy transcript selection outside viewport#8449
joshka-oai merged 1 commit intomainfrom
joshka/tui2-copy-offscreen-lines

Conversation

@joshka-oai
Copy link
Collaborator

@joshka-oai joshka-oai commented Dec 22, 2025

Copy now operates on the full logical selection range (anchor..head), not just the visible viewport, so selections that include offscreen lines copy the expected text.

Selection extraction is factored into transcript_selection to make the logic easier to test and reason about. It reconstructs the wrapped visual transcript, renders each wrapped line into a 1-row offscreen Buffer, and reads the selected cells. This keeps clipboard text aligned with what is rendered (gutter, indentation, wrapping).

Additional behavior:

  • Skip continuation cells for wide glyphs (e.g. CJK) so copied text does not include spurious spaces like "コ X".
  • Avoid copying right-margin padding spaces.

Manual tested performed:

  • "tell me a story" a few times
  • scroll up, select text, scroll down, copy text
  • confirm copied text is what you expect

Copy now operates on the full logical selection range (anchor..head),
not just the visible viewport, so selections that include offscreen lines
copy the expected text.

Selection extraction is factored into `transcript_selection` to make the
logic easier to test and reason about. It reconstructs the wrapped visual
transcript, renders each wrapped line into a 1-row offscreen Buffer, and
reads the selected cells. This keeps clipboard text aligned with what is
rendered (gutter, indentation, wrapping).

Additional behavior:
- Skip continuation cells for wide glyphs (e.g. CJK) so copied text does
  not include spurious spaces like "コ X".
- Avoid copying right-margin padding spaces.
@joshka-oai joshka-oai force-pushed the joshka/tui2-copy-offscreen-lines branch from 7c88682 to 0d1e6a0 Compare December 22, 2025 22:12
@joshka-oai joshka-oai merged commit 7d0c5c7 into main Dec 22, 2025
41 of 49 checks passed
@joshka-oai joshka-oai deleted the joshka/tui2-copy-offscreen-lines branch December 22, 2025 23:24
@github-actions github-actions bot locked and limited conversation to collaborators Dec 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants