The Mac keyboard in Linux apps
Command-key shortcuts, Mac text navigation, and why terminals are treated differently.
On this page 6 sections
Three switches, all on by default, that let a Mac keyboard drive a Linux app.
Mac shortcuts in Linux apps#
Command-key shortcuts arrive as the Control-key ones Linux apps expect.
| You press | The Linux app sees |
|---|---|
| ⌘C, ⌘V, ⌘X | Ctrl+C, Ctrl+V, Ctrl+X |
| ⌘Z, ⇧⌘Z | Ctrl+Z, Ctrl+Shift+Z |
| ⌘S, ⌘O, ⌘N, ⌘W | Ctrl+S, Ctrl+O, Ctrl+N, Ctrl+W |
| ⌘F, ⌘A, ⌘P | Ctrl+F, Ctrl+A, Ctrl+P |
Anything else with Command follows the same rule, keeping Shift and Option.
macOS keeps its own#
Some shortcuts never reach Linux, because they are the Mac's:
| Kept by macOS | What it still does |
|---|---|
| ⌘Q | Quits the app, with its usual "save your work?" prompt |
| ⌘H, ⌥⌘H | Hide, Hide Others |
| ⌘M, ⌥⌘M | Minimise, Minimise All |
| ⌘` | Cycle that app's windows |
| anything with ⌃⌘ | Full screen, lock screen, the character picker |
| ⌘Space, ⌘Tab | Spotlight and app switching, which macOS takes first |
Plain Control is never touched — it is Linux's own modifier, and Ctrl+C in a Linux app means what it has always meant.
Terminals are different, on purpose#
In a terminal, Ctrl+C is not copy. It interrupts whatever is running. A straight Command-to-Control mapping would mean pressing ⌘C to copy killed your build, ⌘D closed the shell and ⌘Z suspended it.
So MSL recognises terminal emulators and treats them separately:
| Terminal | What ⌘C does |
|---|---|
| GNOME Terminal, Konsole, kitty, alacritty, foot, Tilix, Terminator and similar | Arrives as Ctrl+Shift+C, which is what those terminals bind copy to |
| xterm, urxvt, st | Nothing at all |
In the terminals that do bind them, ⌘⌫ clears to the start of the line and ⌥⌫ deletes the word before the cursor, which is what a shell prompt understands.
Mac text navigation#
The Mac's text moves, translated for Linux text fields:
| You press | The Linux app sees |
|---|---|
| ⌘← / ⌘→ | Home / End |
| ⌘↑ / ⌘↓ | Ctrl+Home / Ctrl+End (start and end of the document) |
| ⌥← / ⌥→ | Ctrl+← / Ctrl+→ (a word at a time) |
| ⌘⌫ | Delete to the start of the line |
| ⌥⌫ | Delete the word before the cursor |
Holding Shift extends the selection, as it does everywhere else.
The Option keys#
A Mac's Option key does two jobs a PC keyboard splits between two keys: it is Alt for shortcuts, and it types characters like a-acute and the trademark sign. The Option keys choice decides which job each one does in Linux apps:
| Choice | Left Option | Right Option |
|---|---|---|
| Like a PC (default) | Alt | Types special characters (AltGr) |
| Both are Alt | Alt | Alt |
| Like a Mac app | Special characters | Special characters |
Screenshot keys#
With this on, ⇧⌘3, ⇧⌘4 and ⇧⌘5 are sent through to Linux as Print, Shift+Print and Alt+Print — the keys Linux screenshot tools listen for.