Introduce `toggle_macos_option_as_alt` binding action
As discussed here: https://github.com/ghostty-org/ghostty/discussions/2517
This is a feature of Terminal.app that seems worthwhile to add, both as a binding action and as a menu action to mimic Terminal.app. The default binding of option+command+O can also be copied from Terminal.app.
Since this is a binary toggle and macos-option-as-alt is not a binary configuration, I believe the behavior of the action should be as follows:
- Default the toggle to the value of the configuration. If
macos-option-as-altis true, it should show up checked. - When untoggled, the value goes to
false. - When retoggled, the value returns back to the configured truthy value (if set) or
trueotherwise. This behavior lets the "on" behavior match what the user desired by default (left/right/true).
We should be clear in the documentation for the binding action how this behaves.
The discussion also noted a UI indication when this turns on and off. If we can get that in, that's great, but if not we can defer that to future work.
Hi all,
I stumbled on this issue earlier today while exploring GNU Readline.
Since @nico already has worked on this, would it be okay if I take a stab at adding the keybinding cmd + opt + o to toggle the Option key as Alt?