Skip to content

Comments

fix(app): implement ctrl-y yank for killed text in prompt#14596

Closed
joshuaisaact wants to merge 1 commit intoanomalyco:devfrom
joshuaisaact:fix/ctrl-y-yank
Closed

fix(app): implement ctrl-y yank for killed text in prompt#14596
joshuaisaact wants to merge 1 commit intoanomalyco:devfrom
joshuaisaact:fix/ctrl-y-yank

Conversation

@joshuaisaact
Copy link

@joshuaisaact joshuaisaact commented Feb 21, 2026

Closes #14577

Type of change

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

What does this PR do?

ctrl-k and ctrl-u kill text but it just disappears. There's no way to get it back with ctrl-y because nothing stores the killed text and no yank keybind exists.

The proper fix would probably be a kill ring inside opentui's textarea so every textarea in the app gets it for free. This takes the quicker route and handles it at the app level instead. Before the textarea processes a ctrl-k/ctrl-u, the onKeyDown handler grabs the text that's about to be deleted and stashes it. ctrl-y reads it back and inserts it. Happy to move this into opentui if that's preferred.

Also added input_yank to the keybinds config/schema/openapi so it's user-configurable like the other input bindings.

How did you verify your code works?

  • Ran bun run dev from packages/opencode, typed stuff, ctrl-a, ctrl-k, ctrl-y. Works
  • ctrl-u then ctrl-y also works
  • bun turbo typecheck passes

Screenshots / recordings

No UI changes, keyboard behavior only.

Checklist

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

@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Feb 21, 2026
@github-actions
Copy link
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found one potentially related PR:

Related PR:

This PR may be related because it also deals with readline-style text handling in the TUI, which could include yank/kill functionality. However, since #6778 appears to be an older PR (likely merged or closed), it's probably addressing a different aspect of text transformations.

The current PR (#14596) is specifically implementing the missing yank functionality for Ctrl-K/Ctrl-U killed text, which appears to be a distinct feature addition.

Ctrl-K and Ctrl-U delete text but the killed text was lost with no way
to paste it back. Add a kill ring buffer that captures text before
deletion and a new input_yank keybind (ctrl+y) to re-insert it.
@github-actions
Copy link
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions bot closed this Feb 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:compliance This means the issue will auto-close after 2 hours.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ctrl-A, Ctrl-K and a final Ctrl-Y doesn't paste the line

1 participant