MSL Wiki
MSL on GitHub

The Mac keyboard in Linux apps

Command-key shortcuts, Mac text navigation, and why terminals are treated differently.

Chapter 12 of 203 min read
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 pressThe Linux app sees
⌘C, ⌘V, ⌘XCtrl+C, Ctrl+V, Ctrl+X
⌘Z, ⇧⌘ZCtrl+Z, Ctrl+Shift+Z
⌘S, ⌘O, ⌘N, ⌘WCtrl+S, Ctrl+O, Ctrl+N, Ctrl+W
⌘F, ⌘A, ⌘PCtrl+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 macOSWhat it still does
⌘QQuits the app, with its usual "save your work?" prompt
⌘H, ⌥⌘HHide, Hide Others
⌘M, ⌥⌘MMinimise, Minimise All
⌘`Cycle that app's windows
anything with ⌃⌘Full screen, lock screen, the character picker
⌘Space, ⌘TabSpotlight 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:

TerminalWhat ⌘C does
GNOME Terminal, Konsole, kitty, alacritty, foot, Tilix, Terminator and similarArrives as Ctrl+Shift+C, which is what those terminals bind copy to
xterm, urxvt, stNothing 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 pressThe 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:

ChoiceLeft OptionRight Option
Like a PC (default)AltTypes special characters (AltGr)
Both are AltAltAlt
Like a Mac appSpecial charactersSpecial 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.