mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-24 20:45:56 +03:00
[GH-ISSUE #551] Option+Backspace (Alt+Delete) key events not detected reliably on macOS (Ghostty) #148
Labels
No labels
bug
core
documentation
feature
good first issue
help wanted
pull-request
question
react
solid
tmux
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentui#148
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @LeonMueller-OneAndOnly on GitHub (Jan 19, 2026).
Original GitHub issue: https://github.com/anomalyco/opentui/issues/551
Description:
I am trying to implement "delete word backward" functionality in a component using
useKeyboardfrom@opentui/solid. The standard behavior for this on macOS isOption+Backspace.I attempted to catch this event using the following logic:
Issue:
This condition fails to trigger on Ghostty (macOS), suggesting the key event is not being parsed correctly by
@opentui/core.evt.optionorevt.metamay not be set correctly for the Backspace key in this environment.Option+Backspacemight not be handled in the key parser.Environment:
@opentui/core/@opentui/solidExpected Behavior:
Option+Backspaceshould result in aKeyEventwherenameis"backspace"(or"delete") andoption(ormeta) istrue.@msmps commented on GitHub (Jan 19, 2026):
@LeonMueller-OneAndOnly have you tested this with the following config set in ghostty? macos-option-as-alt = true
@LeonMueller-OneAndOnly commented on GitHub (Jan 19, 2026):
This seems to be an issue on Ghossty's side - using other terminal emulators like the VSCode built in one, I do not have this issue.
@LeonMueller-OneAndOnly commented on GitHub (Jan 19, 2026):
Thank you very much! This is the issue - sorry for the false issue report here.
Keep on the good work and have a great day!
@LeonMueller-OneAndOnly commented on GitHub (Jan 19, 2026):
The issue when using that config option (macos-option-as-alt = true) in Ghostty + OpenCode is, that now the alt-key can't be used anymore to enter chars like "[" or "{" - at least on German keyboards where we rely on the alt-key for these symbols.
This is not an issue of OpenTUI, but I think we could improve the default behaviour here.
Ghostty handles Option-sequences so that in case they don't produce a printable character, it will be treated as alt. This is a very sensible default in my opinion.
I am currently thinking whether we could replicate this behaviour from Ghostty in OpenTUI.
But I have to admit I am not very familiar with terminal implementations and their behaviour. Therefore, I would like your opinion on this:
Is such a "feature" a sensible idea for this library?
Or would this lead down a route where we would have to maintain extra code for every terminal emulator out there?
For context: here is the excerpt from the documentation of Ghostty: