fix: enable Option+Backspace word deletion in terminal#349
fix: enable Option+Backspace word deletion in terminal#349AndresGonzalez5 wants to merge 1 commit intoalltuner:mainfrom
Conversation
Left Option key now acts as Alt/Meta in the embedded Ghostty terminal, so Option+Backspace sends ESC+DEL (delete word) instead of composing a special character. Right Option remains the macOS compose key. Changes: - TerminalApp: loads `macos-option-as-alt = left` into Ghostty config - TerminalView: uses `ghostty_surface_key_translation_mods` to translate modifier flags before `interpretKeyEvents`, so the text input system sees the base character rather than a composed one - TerminalView: adds sided modifier detection (NX_DEVICE*) to `flagsToGhosttyMods` so Ghostty can distinguish left vs right Option - TerminalView: adds `ghosttyModsToFlags` reverse helper Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
I always use left option instead of the one on the right, so I put |
|
Thanks for the PR! A couple of questions before we move forward:
Asking because this determines the right fix. One concern with the current approach: |
|
No problem! I've been playing with the project a bit to fit the specific AI workflow I already had with worktrees.
I also had to jump through some hoops in order to build the xcFramework in macOS Tahoe, if it makes any difference. |
Summary
macos-option-as-alt = leftso the left Option key acts as Alt/MetakeyDownusing Ghostty'sghostty_surface_key_translation_modsAPI, sointerpretKeyEventssees the base characterNX_DEVICE*masks) to distinguish left vs right OptionChanges
TerminalApp.swift: Loadsmacos-option-as-alt = leftconfig into Ghostty at initTerminalView.swift: Translates modifier flags beforeinterpretKeyEventsusing Ghostty's translation API; adds sided modifier detection andghosttyModsToFlagsreverse helperTest plan
á(compose key still works)ñ🤖 Generated with Claude Code