Repository navigation
feat: copy selected text - #58
Merged
Merged
Conversation
Dragging over text now puts it on the clipboard when the button is released, with a `Copied N chars` status line. Prefers the local clipboard command (pbcopy, wl-copy, xclip, xsel, clip.exe) and falls back to OSC 52 over SSH. Command-first because a multiplexer can swallow OSC 52 while still reporting success — tmux `set-clipboard external` drops it silently, leaving nothing to detect and fall back from. The half-block cells padding an inline-code pill are stripped from the copied text, and selections paint `theme.selectionBg` instead of reverse video.
Startup benchmark (
|
| build | mean | ratio | verdict |
|---|---|---|---|
| baseline (main@beedc6d) | 359.7ms ± 5.3ms | — | |
| PR | 364.5ms ± 9.2ms | 1.01× | ✅ ok |
Thresholds: warn ≥ 1.1×, fail ≥ 1.25×. Baseline built from main.
First-frame (large.md, runs=10)
| metric | baseline (main@beedc6d) | PR | ratio | verdict |
|---|---|---|---|---|
| first-frame | 271.1ms | 273.1ms | 1.01× | ✅ ok |
Thresholds: warn ≥ 1.1×, fail ≥ 1.25×. Baseline built from main.
Scroll (large.md)
| metric | baseline (main@beedc6d) | PR | ratio | verdict |
|---|---|---|---|---|
| full_mount | 10248.0ms | 10772.0ms | 1.05× | ✅ ok |
| step_p50 | 23.2ms | 22.3ms | 0.96× | ✅ ok |
| step_search_p50 | 22.8ms | 23.3ms | 1.03× | ✅ ok |
| stepMatch_p50 | 17.2ms | 17.9ms | 1.04× | ✅ ok |
| commit | 139.7ms | 146.7ms | 1.05× | ✅ ok |
Thresholds: warn ≥ 1.1×, fail ≥ 1.25×. Baseline built from main.
denolfe
added a commit
that referenced
this pull request
Sep 9, 2026
- feat: copy selected text (#58) (a9f836e) - fix(hr): stop adding a resize listener per horizontal rule (#57) (beedc6d) - ci: add first-frame and scroll benchmarks to the PR bench job (#56) (b7ab07d) - perf: improve first frame and progressive-mount speed, optimize large documents (#54) (3b6d9f2) - chore(ci): pin bun 1.4.1 via mise (#53) (f596175)
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.
Dragging over text in the viewer now copies it to the clipboard when the mouse button is released. The status line reports the result.
Key Changes
Appcopies the text and shows aCopied N charsstatus.resolveCopyStrategyprefers a local clipboard command: pbcopy, wl-copy, xclip, xsel, or clip.exe.theme.selectionBginstead of reverse video. Text keeps its own foreground color.Design Decisions
The clipboard path is resolved before the copy, not after a failure. tmux configured with
set-clipboard externaldiscards an application's OSC 52 request, and the OpenTUI call still reports success. A fallback triggered by failure would never fire, so a local command wins whenever the session is not remote.The selection color is seeded on OpenTUI's shared text renderable base class rather than passed as a prop. OpenTUI exposes
selectionBgper renderable with no app-wide default. The viewer mounts blocks progressively, so every current and future text element would otherwise have to carry the prop.References / Links
set-clipboardforwards an application's clipboard request.