Skip to content

feat(tui): add Ctrl+Q hotkey to quote selected text into prompt - #21026

Closed
JosXa wants to merge 1 commit into
anomalyco:devfrom
JosXa:quote-selection-hotkey
Closed

feat(tui): add Ctrl+Q hotkey to quote selected text into prompt#21026
JosXa wants to merge 1 commit into
anomalyco:devfrom
JosXa:quote-selection-hotkey

Conversation

@JosXa

@JosXa JosXa commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #21025

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Lets you select text in the transcript and press Ctrl+Q to 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.ts gets the new keybind entry with ctrl+q as default.
selection.ts gains two helpers: text() to read the current selection and quote() to format it with > prefixes and CRLF normalization.
prompt/index.tsx registers a hidden command (prompt.quote_selection) that reads the selection, quotes it, inserts at the cursor, and clears the selection.
app.tsx intercepts 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

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

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
@rekram1-node

Copy link
Copy Markdown
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:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Quote selected transcript text into the prompt

2 participants