GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(tui): copy the paste inside the prompt selection by jlongster · Pull Request #63275 · anomalyco/opencode

Conversation

@jlongster

@jlongster jlongster commented Nov 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Issue for this PR

Follow-up to #59209: selecting just the second of two equally labeled pastes still copies the first paste.

Type of change

  • Bug fix

What does this PR do?

The textarea highlights the correct label, but searching that substring for the first matching label loses the paste’s position. For a selection inside the prompt, expand only the tracked paste ranges fully inside the native selection. A clipped label or a lookalike typed by hand copies literally.

How did you verify your code works?

Selected cells [19,36) in a native textarea and pressed Ctrl+C. Dev wrote the four lines starting with cedar; this change wrote the selected four lines starting with ink $$. Five of ten cases diverged on dev, and all ten matched on the fix.

Replay, revisions and controls

Replay script · Complete replay bundle · Visualize base / fix

Extract the bundle and run with an installed OpenCode workspace (Linux, Bun 1.4.2, OpenTUI 0.8.4) containing base and fix:

set -o pipefail
export OPENCODE_REPO=/path/to/installed/opencode
git -C "$OPENCODE_REPO" fetch origin refs/heads/dev refs/heads/fix/tui-copy-selected-paste
bash run.sh 39502786382a965ee98497c9557a0b7afe2e6f4c | cmp base.json -
bash run.sh d979d431287c502004c2008b565dd9bbe1643db6 | cmp fix.json -

Controls cover first/second paste, clipped and crossing ranges, full selection, Escape, and a literal label between two tracked pastes after a wide/combining prefix. The selected payload includes LF, dollar sequences and another label. Each receipt repeated byte-for-byte. A local merge with undo draft #63265 passed these ten cases and its eight submission cases.

The measurement ends at the synthetic clipboard callback. The heavy-workload guard deferred broad checks. Selections spanning multiple renderables still use the existing expansion path.

Screenshots / recordings

Before (dev 3950278638) and after (fix d979d43128), side by side

Real TUI in a terminal with the app's own X11 clipboard: two pastes with the same label, mouse-select only the second, Ctrl+C, paste and send. Left: dev copies the first paste (cedar, plum, ash, oak). Right: the fix copies the selected one (ink, moss, fern, slate). MP4

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jlongster
fix(tui): copy the paste inside the prompt selection
d979d43
User decisions:
- Fix selection copy on dev
- Keep replay evidence outside the production patch
@github-actions github-actions Bot added the contributor label Nov 11, 2026
@jlongster
jlongster marked this pull request as ready for review November 12, 2026 16:45
@jlongster
jlongster enabled auto-merge (squash) November 12, 2026 16:45
opencodejr[bot]
opencodejr Bot reviewed Nov 12, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix works. I reproduced the bug on the base with a temporary app-level test: two pastes with the same [Pasted ~3 lines] label, a mouse selection around only the second label, then Ctrl+C. The base copied the first paste's text and this PR copies the second's. The existing prompt and selection tests pass, and tsc -b in packages/tui is clean.

The new path reads the paste positions kept in the prompt store, which are re-synced from extmarks on every content change. It falls back to the old label search when the selection spans other renderables, so I found no regressions.

Public API: unchanged. This is internal TUI clipboard behaviour only.

No blocking concerns.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jlongster
jlongster merged commit 28f74f8 into dev Nov 12, 2026
19 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@jlongster
jlongster deleted the fix/tui-copy-selected-paste branch November 12, 2026 16:50
@jlongster

jlongster commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review. The description now has a real recording of both revisions in a terminal with the app's own X11 clipboard: select only the second of two same-label pastes, Ctrl+C, paste and send. 3950278638 copies the first paste; d979d43128 copies the selected one.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kobzevvv kobzevvv mentioned this pull request Nov 13, 2026
chore(upstream): порт v2.3.0 — 101 в порт, 75 на решение gpt-mem/opencode-mem#222
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@opencodejr opencodejr[bot] opencodejr[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

contributor

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@jlongster
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.