fix(app): implement ctrl-y yank for killed text in prompt#14596
fix(app): implement ctrl-y yank for killed text in prompt#14596joshuaisaact wants to merge 1 commit intoanomalyco:devfrom
Conversation
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
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. |
|
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.
d90c3ed to
d39feb7
Compare
|
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. |
Closes #14577
Type of change
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
onKeyDownhandler 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_yankto the keybinds config/schema/openapi so it's user-configurable like the other input bindings.How did you verify your code works?
bun run devfrompackages/opencode, typed stuff, ctrl-a, ctrl-k, ctrl-y. Worksbun turbo typecheckpassesScreenshots / recordings
No UI changes, keyboard behavior only.
Checklist