fix(tui): handle Home and End keys in prompt input - #31489
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate FoundPR #19135: fix(opencode): restore Home/End prompt navigation in TUI This PR appears to be directly related—it specifically addresses Home/End key navigation in the TUI prompt, which is the same functionality being fixed in the current PR #31489. This could indicate:
You should check PR #19135 to understand the prior implementation and why the issue (#27661) may have reappeared. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
| if (props.disabled) { | ||
| e.preventDefault() | ||
| return | ||
| } | ||
| if (e.name === "end") { |
There was a problem hiding this comment.
You have hardcoded the HOME and END keys, which overcorrected the PR bound as a modification keybinds. To change keybind edit tui.json
|
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. |
Issue for this PR
Closes #27661
Type of change
What does this PR do?
The Home and End keys did not navigate to the start/end of text in the prompt textarea. Add explicit handling in onKeyDown to move the cursor to buffer start (Home) and buffer end (End).
How did you verify your code works?
Verified by running
bun devand pressing Home/End in the prompt input — cursor now jumps to the beginning and end of the text as expected.Screenshots / recordings
If this is a UI change, please include a screenshot or recording.
Checklist
If you do not follow this template your PR will be automatically rejected.