Repository navigation
Keep terminal Copy enabled so Cmd+C works on agent TUI panes - #14557
Conversation
ghostty_surface_has_selection can report false while the runtime still holds a live selection, for example under constant TUI redraw in agent panes. Gating the Copy menu item on it greyed Copy out and swallowed Cmd+C. Enable Copy whenever a surface exists; copying with no selection is a no-op. Salvaged from #8064. Co-Authored-By: a05031113 <a05031113@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 9 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
All contributors have signed the CLA ✍️ ✅ |
|
Merge receipt for
Labeled |
Salvaged from #8064 by @a05031113. That PR no longer merges cleanly, so this lands the one piece that is still broken on main.
Problem
On agent TUI panes (Claude Code, Codex, etc.) Edit > Copy can be greyed out while text is visibly selected, and Cmd+C does nothing.
validateUserInterfaceItemgated Copy onghostty_surface_has_selection, which can report false while the runtime still holds a live selection under constant TUI redraw. A disabled Copy item means the menu misses, and since #8895 that miss is consumed as a no-op, so the copy never happens.Fix
Enable Copy whenever the view has a surface.
copy(_:)already runs the configured copy binding and falls back to the selection snapshot, so copying with no selection is still a no-op and never reaches the PTY.The right-click context menu still shows Copy only when there is a selection; that is unchanged.
Not ported from #8064
The other two fixes in #8064 (empty clipboard writes clearing the pasteboard, and the VT-export capture race) were superseded by the
TerminalPasteboardServicerewrite in #8838, so they are left out here.Tradeoff to review
A user with a
performable:cmd+c=copy_to_clipboardbinding previously had Cmd+C fall through to the terminal when nothing was selected. With Copy always enabled, the menu now handles Cmd+C and it does not fall through. This is rare but deliberate; flag it if we want to keep that path.Testing
No focused unit test: #8064 had none for this piece and it depends on live runtime selection state. Needs CI compile plus a manual check: select text in a busy agent pane, Cmd+C, paste.
Co-authored with @a05031113 (credited in the commit trailer).
🤖 Generated with Claude Code
Summary by cubic
Fixes Cmd+C not copying on agent TUI panes (Claude Code, Codex, etc.) when text is visibly selected but Copy is greyed out.
ghostty_surface_has_selectioncan report false under constant TUI redraw, and a disabled Copy menu item swallows Cmd+C before the runtime's copy binding handles it. Copy is now enabled whenever a surface exists; copying with no selection is still a no-op, and the right-click menu still only shows Copy when there is a selection.Tradeoff to review
performable:cmd+c=copy_to_clipboardbinding previously had Cmd+C fall through to the terminal when nothing was selected; it now hits the menu as a no-op instead.Written for commit 60ba574. Summary will update on new commits.