remapping of ctrl/cmd keys on macos #3493
Replies: 7 comments 13 replies
-
Fwiw, and this isn't a solution to your problem in Ghostty - but you might appreciate an OS remapping via:
Then this works everywhere and you don't have to worry about application support. Note: You would need to set this up to execute anytime you reboot. |
Beta Was this translation helpful? Give feedback.
-
@berdon thank you! i'll give this a try next time i'm at my computer |
Beta Was this translation helpful? Give feedback.
-
Converted to a discussion, I like the idea of remapping modifiers and it has come up before. We don't have a way to do this at the Ghostty level. I'm curious how this ends up working in practice so I'll have to do more research. |
Beta Was this translation helpful? Give feedback.
-
As a quick work around I tried this:
But there are system shortcuts - Like Cmd-M to minimize the window - that take priority, so only some of these work. |
Beta Was this translation helpful? Give feedback.
-
It would be helpful to extend this feature to support the Option and Command keys on macOS. This would enable a more “natural” usage of |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
Okay, I'd like to accept this proposal, but lets bikeshed on config. Given the modifiers are fixed, I propose something like the following:
etc. This would only work for modifiers. The configuration style leaves open the possibility of remapping other keys but thats a significantly more challenging effort due to keyboard layouts. If a non-sided modifier is specified (i.e. I'm also fine initially making Thoughts? |
Beta Was this translation helpful? Give feedback.
-
hello! i'm migrating from iterm2, and am accustomed to being able to switch my ctrl/cmd keys on macos as attached. is this possible to do with the current
keybind
syntax in the ghostty config? i gave it a try but couldn't replicate the behaviour I have in iterm2 with these settings.Beta Was this translation helpful? Give feedback.
All reactions