How to Use the Option Key as Alt in Alacritty on macOS

Shaking up my tech stack has been fantastic, until it isn’t. I recently transitioned from stock terminal apps to Alacritty, and then swapped out tmux for zellij. The former has treated me well, and the latter has been extremely welcoming. That is, until I learned about some hotkeys using alt that just didn’t work on macOS.

Apple keyboards don’t have an alt key, instead having an option key. Generally speaking, this key functions as an alt key in most of the applications I’ve used previously. Alacritty being the exception to that, but I am very much committed to it, and didn’t want to waste my time exploring other cross-platform terminal options.

Configure option as alt in Alacritty

Fortunately, my buddy Geoff enlightened me to the fact Alacritty has a configuration option that will treat the option key as alt. First, open up your alacritty.toml file, which I keep in ~/.config/alacritty/ but you may have elsewhere.

Then you will look for a [window] section, if you don’t have one, you’ll need to add it. Under that section you’ll add the option_as_alt configuration:

[window]
option_as_alt = 'Both'
alacritty.toml

Once you save the file, Alacritty will automatically source the change, and you should be off to the races. This configuration option only works on macOS, so it’s safe to share with Linux (or Windows, blech).

The Both value is referring to treating both left and right option keys as alt. If you happen to need the option key in the terminal (which if memory serves, I’ve never needed it) you can opt to only treat the left or right option key as alt. Simply change Both to OnlyLeft or OnlyRight.

Josh Sherman - The Man, The Myth, The Avatar

About Josh

Husband. Father. Pug dad. Musician. Founder of Holiday API, Head of Engineering and Emoji Specialist at Mailshake, and author of the best damn Lorem Ipsum Library for PHP.


If you found this article helpful, please consider buying me a coffee.