feat(tui): add Ctrl+Q hotkey to quote selected text into prompt - #21026
Closed
JosXa wants to merge 1 commit into
Closed
feat(tui): add Ctrl+Q hotkey to quote selected text into prompt#21026JosXa wants to merge 1 commit into
JosXa wants to merge 1 commit into
Conversation
Adds a configurable keybind (input_quote_selection, default Ctrl+Q) that inserts the current terminal selection into the prompt as a blockquote. Each line is prefixed with '> ' and the block ends with a blank line. Closes anomalyco#21025
Collaborator
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
6 tasks
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.
Issue for this PR
Closes #21025
Type of change
What does this PR do?
Lets you select text in the transcript and press
Ctrl+Qto insert it into the prompt as a blockquote. Each line gets a>prefix, a trailing blank line is appended, and the terminal selection is cleared afterward. The hotkey is configurable through the existing keybind system (input_quote_selection).Four files touched, all in
packages/opencode:config.tsgets the new keybind entry withctrl+qas default.selection.tsgains two helpers:text()to read the current selection andquote()to format it with>prefixes and CRLF normalization.prompt/index.tsxregisters a hidden command (prompt.quote_selection) that reads the selection, quotes it, inserts at the cursor, and clears the selection.app.tsxintercepts the keybind in the global selection handler before the existing logic can clear the selection out from under us.Nothing outside this feature was changed. The prompt ref shape and plugin slot types are untouched.
How did you verify your code works?
Tested manually in the TUI: selected multi-line output, pressed
Ctrl+Q, confirmed the quoted block landed at cursor position with correct formatting.Screenshots / recordings
WindowsTerminal_TWarB04DJ2.mp4
Checklist