Skip to content
Go back

Configuring the Alt Key for Command Line Navigation in iTerm2

Configuring the Alt Key for Command Line Navigation in iTerm2

I recently came across an excellent book called Effective Shell by David Kerr. I’m currently halfway through the book and have found the chapter Fly on the Command Line particularly useful. It describes shortcuts for navigating quickly on the command line. You can see the image below for a quick reference:

Command line navigation shortcuts diagram

However, I encountered an issue when trying out this chapter on macOS with zsh in iTerm2. The problem was that the Alt key wasn’t working properly. After some research, I discovered that I needed to configure iTerm2 before it could properly process the Alt key. Here’s the fix:

By following the steps above, you should be able to configure your Alt key to work like it would on Linux.


Share this post on:

Previous Post
Using Ctrl+X, Ctrl+E for Better Terminal Command Editing
Next Post
next lint vs next build