You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue might be a duplicate of existing issues. Please check:
TUI crashes during prompt edit #3749: Similar Command+backspace issue on macOS 26.0.1 with Ghostty - user also reports that Command+backspace used to delete a line but nothing happened after updating to 1.0
Hello! I've been investigating this issue (#3783) and I think I've narrowed down the root cause.
The original reporter is on macOS, but I can confirm this is a wider problem, as I'm on Windows and can reproduce a similar bug, Ctrl+Backspace only deletes one character (it's ignoring the Ctrl key).
This suggests the new input component isn't handling modifier keys correctly.
I looked into the opencode TUI code to see if I could find the onKeyDown logic, starting in packages/opencode/src/cli/cmd/tui/ as per the CONTRIBUTING.md.
I found the Prompt component, which renders the <textarea>. In its onKeyDown handler, I noticed it only intercepts specific, custom keybinds:
<textarea
// ...
onKeyDown={async (e: KeyEvent) => {
// ...
// It correctly matches custom keybinds:
if (keybind.match("input_clear", e) && store.prompt.input !== "") {
// ...
}
if (keybind.match("input_forward_delete", e) && store.prompt.input !== "") {
// ...
}
// ...
// BUT: There is no handler for a raw "backspace" key press.
}}
// ...
/>
Since there's no if (e.name === "backspace") block, the default backspace behavior is being handled by the <textarea> component itself.
This strongly suggests the bug is not in the opencode codebase, but in the underlying @opentui/core library that provides the <textarea> component.
It seems the TextareaRenderable from @opentui/core doesn't have the logic to handle event.ctrlKey, event.altKey, or event.metaKey in combination with the backspace key.
Could a maintainer confirm if this is the correct place to look? If so, I'm willing to continue the investigation over in the sst/opentui repository.
Newer versions of opentui/opencode should use kitty keyboard at least, but Ghostty does not support kitty keyboard and emits "\u0015" which is ctrl+u for cmd+backspace.
Activity
github-actions commentedon Nov 3, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
PranshuRaj1 commentedon Nov 3, 2025
Hello! I've been investigating this issue (#3783) and I think I've narrowed down the root cause.
The original reporter is on macOS, but I can confirm this is a wider problem, as I'm on Windows and can reproduce a similar bug, Ctrl+Backspace only deletes one character (it's ignoring the Ctrl key).
This suggests the new input component isn't handling modifier keys correctly.
I looked into the opencode TUI code to see if I could find the onKeyDown logic, starting in packages/opencode/src/cli/cmd/tui/ as per the CONTRIBUTING.md.
I found the Prompt component, which renders the <textarea>. In its onKeyDown handler, I noticed it only intercepts specific, custom keybinds:
Since there's no if (e.name === "backspace") block, the default backspace behavior is being handled by the <textarea> component itself.
This strongly suggests the bug is not in the opencode codebase, but in the underlying @opentui/core library that provides the <textarea> component.
It seems the TextareaRenderable from @opentui/core doesn't have the logic to handle event.ctrlKey, event.altKey, or event.metaKey in combination with the backspace key.
Could a maintainer confirm if this is the correct place to look? If so, I'm willing to continue the investigation over in the sst/opentui repository.
Thanks!
kommander commentedon Nov 17, 2025
Newer versions of opentui/opencode should use kitty keyboard at least, but Ghostty does not support kitty keyboard and emits "\u0015" which is
ctrl+uforcmd+backspace.kommander commentedon Nov 17, 2025
So this can only have worked in earlier versions if
ctrl+uwas mapped to delete line.knotbin commentedon Nov 17, 2025
this actually works now. not exactly the same functionality as it was before but it's functional now