Bash on macOS, alt+d inserts ∂ instead of removing word
After switching to MacOS I noticed the alt+d
shortcut (delete word starting from the cursor position) doesn't work. It inserts ∂
character instead.
This has been asked here: https://stackoverflow.com/q/12335787/12014002 with a suggestion to use another shortcut (Esc than d
) or change the meta key which I don't want to do because it changes a few other things.
However, I'm using another Linux machine and have muscle memory for alt+d
:) Since the other question is 8 years old maybe another solution popped up? The terminal app I'm using is Alacritty.
Cheers!
TL;DR
The best solution I can think of, is to do what this user did to their keymaps in alacritty.yml
— adding a bunch of key-maps that manually capture the Option (⌥) key for all the bindings that you’d ever use meta for.
This is something the Alacritty community has been ruminating about this macOS scenario for about 4.5 years, at the time of writing of this answer (see issue#62 that asks for an option to capture modifier keys that macOS uses differently — like Option (⌥) — for purposes e.g. serving as the meta key).
The Half-full Part
Turns out that the above ticket has been tagged as an enhancement
— i.e., a plausible future feature — by the maintainers of Alacritty. One maintainer also uses the phrase not yet a feature, when referring to the concept (see this comment.)
There could be hope yet! Despite #62 having an over-four-year-long-yet-unresolved history, it is still alive and kicking.
N.B.: Apple Terminal has a built-in keyboard shortcut/menubar item (⌘+⌥+O / Edit → Use Option as Meta Key). iterm
also has a similar option. This may not be a viable option for idetyp, who authored this question, but I’m just putting this here in case it helps a reader for whom it is.