Maksym Prokopov personal blog
Idea is a something worth sharing

Ghostty Remap Cmd to Control under macOS

02.04.2025

We all love the fast software. Ghostty is crazy fast.

What I use with my macos keyboard comes from Emacs. Namely, Cmd+ instead of Control+ for navigation in shell. Jump to a beginning of line, +a, to the end of line +e.

Why?

  1. Because my macOS keyboard doesn’t have TWO Ctrl keys on both sides.
  2. Try to compare ctrl-a vs cmd-a yourself 😀

Here is an example of a config extracted from this discussion.

keybind = cmd+a=text:\x01
keybind = cmd+b=text:\x02
keybind = cmd+c=text:\x03
keybind = cmd+d=text:\x04
keybind = cmd+e=text:\x05
keybind = cmd+f=text:\x06
keybind = cmd+g=text:\x07
keybind = cmd+h=text:\x08
keybind = cmd+i=text:\x09
keybind = cmd+j=text:\x0A
keybind = cmd+k=text:\x0B
keybind = cmd+l=text:\x0C
keybind = cmd+m=text:\x0D
keybind = cmd+n=text:\x0E
keybind = cmd+o=text:\x0F
keybind = cmd+p=text:\x10
keybind = cmd+q=text:\x11
keybind = cmd+r=text:\x12
keybind = cmd+s=text:\x13
# Cmd+t creates a new tab in ghostty
# keybind = cmd+t=text:\x14
keybind = cmd+u=text:\x15
# I'm using cmd+y with paste from macos
# keybind = cmd+v=text:\x16
keybind = cmd+w=text:\x17
keybind = cmd+x=text:\x18
keybind = cmd+y=text:\x19
keybind = cmd+z=text:\x1A
theme = AtomOneLight

It’s much better than using Karabiner Elements, as it doesn’t hijack your Cmd+Tab combination from OS.

In case anyone wonders why you might want to remap modifier keys, here’s the reason: Historically, PCs followed traditional Unix terminals in making the Control keys significant for frequent UI interaction. The first Macintoshes didn’t even have Control keys! It was added later, primarily for uncommon modifiers, secondary mouse clicks, and compatibility. Macs, instead, use the Command ⌘ key for most shortcuts, mirroring the functionality of Ctrl on PCs (e.g., Save is Ctrl+S on PC and Command-S on Mac). As a result, the frequently used Command keys have a prominent location on Mac-only keyboards, just as Control keys are central on PC and Unix keyboards.

On Windows, you’ll stay on the Control keys for all shortcuts, and your Terminal emulator will just work. On Mac, you’ll be using the Command keys for all OS shortcuts, and then in Terminal emulators you must switch to Control instead. This is a little uncomfortable on Apple keyboards since Control is off to one side, but you can manage. Globally remapping Caps Lock to Control is common for seasoned Mac users. 😊 However, these differences can be especially awkward for users switching regularly or transitioning between Mac and Windows, since you’ll have to fight your muscle memory to perform common operations. When using external (“mechanical”) keyboards, this becomes even more of a problem, especially ergonomic keyboards where certain keys are much easier to reach than others.

For me, this creates the perfect storm. I work professionally across Mac, Windows, and Linux, and I rely on fancy ergonomic keyboards to keep my hands from hurting. iTerm2’s functionality to remap the modifiers only in the Terminal window is crucial, allowing me to have consistent OS and Terminal shortcuts, and work comfortably, despite platform differences.