Keyboard

A terminal’s keyboard belongs to the program running in it. Termina keeps its own commands to chords a shell does not use, and handles a few keys itself where every terminal does.

The full list of commands and their chords is on the Keybindings page. This page covers the rules behind them.

Chords that leave the shell its keys

  • On Linux and Windows an application chord is Ctrl+Shift+key, never Ctrl+key. The plain form belongs to the shell: Ctrl+T is readline’s transpose, Ctrl+W deletes a word, Ctrl+C is SIGINT, Ctrl+V is literal-next. So New Tab is Ctrl+Shift+T, Copy is Ctrl+Shift+C and Paste is Ctrl+Shift+V.
  • On macOS it is Cmd+key, because Cmd is not a key a shell ever sees: Cmd+T, Cmd+C, Cmd+V.
  • A few chords are the platform’s own. Settings is Ctrl+, (Cmd+, on macOS). Zoom is Ctrl+=, Ctrl+- and Ctrl+0 (Cmd+=, Cmd+-, Cmd+0). Full Screen is F11 (Ctrl+Cmd+F on macOS). Close Window is Ctrl+Shift+Q, as in GNOME Terminal and Konsole (Cmd+Shift+W on macOS).
  • The chords work with the menu bar hidden. They are handled by the window, ahead of the terminal, not by the menus.

Every chord is declared once, with its menu item, so the menu, the palette and the reference can never advertise a chord that does nothing.

The command palette

Alt+X (Option+X on macOS) opens it. It is Emacs’s M-x, and the chord Editora’s palette uses.

  • Type part of a name. “nw” finds New Window, “tab close” finds Close Tab with the words in either order, and “file new” reaches New Tab through the menu it lives in. The matched letters are shown in bold, and each row shows its chord.
  • Everything is there: every menu command, every open tab by its title (with the chord that reaches it), every shell profile (“New Tab: zsh”), and every theme (“Theme: Clear Dark”).
  • A command that cannot run right now is greyed, not hidden. Reopen Closed Tab, with nothing closed yet, stays in the list with the reason as its tooltip, and the cursor steps over it.
  • A line under the list says what the highlighted command does, and a legend names the keys.
  • Enter or a click runs the command; Esc closes the palette.

The keys in it are the arrows and Emacs’s:

KeyDoes
↑ ↓, Ctrl+P Ctrl+NMove
Ctrl+V / Alt+VPage down / up
Alt+< / Alt+>First / last row
Ctrl+G, EscClose

The query field takes the Emacs editing keys: Ctrl+A, Ctrl+E, Ctrl+F, Ctrl+B, Alt+F, Alt+B, Ctrl+D, Ctrl+K, Alt+D, Ctrl+W, Alt+W, Ctrl+Y and Ctrl+/.

Changing the palette’s chord

Settings → Terminal → Keyboard → Command palette shortcut: click the field and press the new chord. It applies at once, and the View menu and the palette show whichever is in force. Reset puts Alt+X back.

Two kinds of chord are refused, with the reason on the row:

  • A bare key. A function key works on its own; any other key needs Ctrl, Alt or Cmd, or the shell would lose it. Shift alone does not count, since Shift+X is a capital letter.
  • A chord another command already has. Only the first command on a chord would ever run, so the row names the command that has it.

If you use M-x inside the terminal, in Emacs for instance, move the palette to another chord: while Alt+X opens the palette, it never reaches the program.

This is the only chord 0.10.0 can change. Rebinding other commands is not there yet.

The Keyboard Shortcuts reference

Help → Keyboard Shortcuts… (Ctrl+Shift+/, Cmd+/ on macOS) lists every chord the window answers to, grouped by menu, with a search box. It is built from the window’s own binding table, so it cannot list a chord that does not work. It also lists the keys and gestures the terminal handles itself (below). Esc closes it.

Alt, Option and AltGr

  • Alt is Meta by default. Alt+F sends ESC f, which readline reads as M-f (forward a word), and the same goes for M-b, M-d and the rest.
  • On macOS, Option is Meta too, and the key is sent as itself. Option is normally a compose key (Option+F types ƒ), and Termina sends ESC f, not an escape followed by ƒ.
  • Turn it off under Settings → Terminal → Input → Use Alt as Meta to let Alt or Option compose characters instead, which is what macOS Option normally does.
  • AltGr is left alone. On Windows and Linux AltGr arrives as Ctrl+Alt, and layouts use it to type @, { and €. A character AltGr composes reaches the shell as that character.
  • Ctrl+Alt+letter sends Meta plus the control byte, readline’s C-M-f and C-M-b, when the key is the plain letter and not an AltGr character. Like Meta, this needs Alt as Meta on.
  • Printable characters come from what the system composed, so dead keys and input methods work.

Keys the terminal handles itself

KeyDoes
Shift+PageUp / Shift+PageDownScroll back / forward a page
Shift+Home / Shift+EndScroll to the top of the scrollback / to the bottom
Shift+InsertPaste
Ctrl+InsertCopy
Middle-clickPaste the clipboard
Tab, Shift+Tab, EscAlways go to the shell, never to the window
  • The four scrolling keys go to the program on the alternate screen. A full-screen program such as less has no scrollback behind it, and binds Shift+PageUp itself.
  • Middle-click pastes the clipboard, not the X11 primary selection, which JavaFX cannot read.
  • Esc does not leave full screen. Only F11 (Ctrl+Cmd+F on macOS) does, so Esc in vim leaves insert mode as it should.
  • Ctrl+3 through Ctrl+8 send xterm’s control bytes, and the keypad arrows work with NumLock off.

The mouse gestures, such as Shift+drag to select inside a program that has the mouse, are on Selection and the mouse.

Tabs from the keyboard

KeyDoes
Alt+1 … Alt+8 (Cmd+1 … Cmd+8)Go to that tab
Alt+9 (Cmd+9)Go to the last tab, however many are open
Ctrl+Shift+] / Ctrl+Shift+[ (Cmd+Shift+] / Cmd+Shift+[)Next / previous tab
Ctrl+Shift+← / Ctrl+Shift+→ (Cmd+Shift+← / Cmd+Shift+→)Move the tab left / right
Ctrl+Shift+1 … Ctrl+Shift+9 (Cmd+Shift+1 … Cmd+Shift+9)New tab with profile 1 to 9

A number past the last tab selects nothing, so that you do not land on the wrong tab. See Tabs and windows and Shell profiles.