Keybindings

Every default key in TUIOS for window mode, terminal mode, prefix commands, copy mode and the mouse, grouped by the config section that owns it.

TUIOS has two modes. Window mode is for managing panes. Terminal mode sends your keys to the focused pane. A new session starts in window mode.

The leader key is Ctrl+B. Press it, release it, then press a command key. The leader works in both modes.

Every table on this page names the config section that holds the binding and the action name to use in it. Every action is rebindable. See Customizing at the end.

Try it live: Learn tuios has you press these keys in the real app, in your browser. Free play has a cheat sheet you can click.

Check your own bindings

This page lists the defaults. tuios keybinds list, tuios keybinds explain <key> and the keybind manager (Ctrl+B k) show what is bound on your machine.

Modes

Section: [keybindings.mode_control]. These keys work in window mode.

KeyActionDoes
i, Enterenter_terminal_modeEnter terminal mode
Escenter_window_modeEnter window mode
?toggle_helpToggle the help overlay
,open_settingsOpen the settings page
qquitQuit
nonehold_window_modeWindow mode while the key is held. Unbound by default

To leave terminal mode, press Ctrl+B Esc, or the direct key from Terminal mode.

hold_window_mode needs a terminal that speaks the Kitty keyboard protocol (Ghostty, kitty, WezTerm, foot, Alacritty), because only that protocol reports key releases. Bind it to an ordinary spare key, such as an unused function key from f1 to f12. Binding a modifier such as leftalt also works, but then every keystroke in the session arrives as an escape code.

Window mode

Windows

Section: [keybindings.window_management].

KeyActionDoes
nnew_windowNew window
Nnew_sessionNew session. Asks which machine when there is more than one
w, xclose_windowClose the focused window
rrename_windowRename the focused window
mminimize_windowMinimize the focused window
Mrestore_allRestore all minimized windows
ztoggle_zoomZoom the focused window, or unzoom it
Tabnext_windowFocus the next window
Shift+Tabprev_windowFocus the previous window
1 to 9select_window_1 to select_window_9Focus a window by number
ccopy_selectionCopy the mouse selection
sfocus_sidebarGive the keyboard to the session rail
Sstart_screensaverStart the screen saver now
Alt+Shift+Nnext_sessionNext session
Alt+Shift+Pprev_sessionPrevious session

Section [keybindings.restore_minimized] restores one minimized window by position:

KeyAction
Shift+1 to Shift+9 (also ! to ()restore_minimized_1 to restore_minimized_9

Section [keybindings.system] has one binding: b is toggle_spotlight, which lights one part of the screen and dims the rest. See the [spotlight] options in Configuration.

Workspaces

Section: [keybindings.workspaces]. There are nine workspaces. The modifier is Option on macOS and Alt elsewhere.

KeyActionDoes
Alt+1 to Alt+9switch_workspace_1 to switch_workspace_9Show a workspace
Alt+Shift+1 to Alt+Shift+9move_and_follow_1 to move_and_follow_9Move the focused window there and follow it

Layout and snapping

Section: [keybindings.layout].

KeyActionDoes
ttoggle_tilingTurn tiling on or off
hsnap_leftSnap to the left half. In tiling, focus left
lsnap_rightSnap to the right half. In tiling, focus right
fsnap_fullscreenFill the screen
uunsnapRestore the size before the snap
H, Ctrl+swap_leftSwap with the window to the left
L, Ctrl+swap_rightSwap with the window to the right
K, Ctrl+swap_upSwap with the window above
J, Ctrl+swap_downSwap with the window below
<resize_master_shrinkNarrow the master area
>resize_master_growWiden the master area
{resize_height_shrinkShorten the focused window from the bottom edge
}resize_height_growLengthen the focused window from the bottom edge
.resize_master_grow_leftWiden the master area from the left edge
[resize_height_shrink_topShorten the focused window from the top edge
]resize_height_grow_topLengthen the focused window from the top edge
noneresize_master_shrink_leftNarrow the master area from the left edge. Unbound by default

resize_master_shrink_left has no default because , opens settings. Bind it to a free key if you want it.

Corner snapping is on the layout prefix, not on the bare digits.

BSP splits

Also in [keybindings.layout]. See BSP Tiling.

KeyActionDoes
-split_horizontalSplit the focused pane top and bottom
|, \split_verticalSplit the focused pane left and right
Rrotate_splitFlip the split direction
=equalize_splitsReset every split ratio
Alt+h / j / k / lpreselect_left, preselect_down, preselect_up, preselect_rightChoose where the next window opens

The preselect keys use Option on macOS. The prefix menu has its own copies of the four split actions, and rebinding one set does not change the other.

Terminal mode

Section: [keybindings.terminal_mode]. These keys work in terminal mode with no prefix. Everything else goes to the pane.

KeyActionDoes
Alt+nterminal_next_windowFocus the next window
Alt+pterminal_prev_windowFocus the previous window
Alt+Escterminal_exit_modeGo to window mode
Alt+arrowsterminal_focus_left, _right, _up, _downFocus the pane in that direction
Shift+terminal_scroll_upScroll into the pane's scrollback
Shift+terminal_scroll_downScroll back toward live output
Ctrl+Shift+V, Super+Vterminal_paste_hostPaste from the host clipboard
KeyActionDoes
Option+Tab, Alt+nterminal_next_windowFocus the next window
Option+Shift+Tab, Alt+pterminal_prev_windowFocus the previous window
Option+Escterminal_exit_modeGo to window mode
Alt+arrowsterminal_focus_left, _right, _up, _downFocus the pane in that direction
Shift+terminal_scroll_upScroll into the pane's scrollback
Shift+terminal_scroll_downScroll back toward live output
Ctrl+Shift+V, Super+Vterminal_paste_hostPaste from the host clipboard

Alt+Left and Alt+Right cost you word motions

Readline, fish and zsh use Alt+ and Alt+ to move a word at a time. To give them back, run tuios keybinds free alt+left and tuios keybinds free alt+right. Ctrl+B then an arrow still moves focus.

Plain Ctrl+V is not bound. It reaches the pane, so vim's visual block mode works.

Global keys

Section: [keybindings.global]. These keys work in window mode and terminal mode.

KeyActionDoes
Ctrl+Pcommand_paletteOpen the command palette
Alt+SpacelauncherOpen the app launcher

The command palette searches commands, sessions and windows. Start the query with @ to filter panes by agent state (@n for needs input), or with # to search actions to rebind.

The app launcher lists every executable on $PATH, ranked by use. Enter runs the selection in a new pane with no shell in between. Tab types the command into the focused shell instead, so you can add arguments.

These two keys take Ctrl+P from fish and vim and Alt+Space from readline. Set an action to [] to give its key back. On macOS, Option+Space types a non-breaking space, so use Ctrl+B a for the launcher.

Prefix commands

Press Ctrl+B, then the key. Section: [keybindings.prefix_mode].

KeyActionDoes
cprefix_new_windowNew window
xprefix_close_windowClose the focused window
rprefix_rename_windowRename the focused window
n, Tabprefix_next_windowNext window
p, Shift+Tabprefix_prev_windowPrevious window
0 to 9prefix_select_0 to prefix_select_9Jump to a window
arrowsterminal_focus_left, _right, _up, _downFocus the pane in that direction
)next_sessionNext session
(prev_sessionPrevious session
Spaceprefix_toggle_tilingTurn tiling on or off
zprefix_fullscreenZoom the focused window
-prefix_split_horizontalSplit top and bottom
|, \prefix_split_verticalSplit left and right
Rprefix_rotate_splitFlip the split direction
=prefix_equalize_splitsReset every split ratio
[prefix_selectionEnter copy mode
sprefix_scrollbackOpen the scrollback browser
Cprefix_screenshotTake a screenshot
Pprefix_command_paletteOpen the command palette
alauncherOpen the app launcher
,prefix_settingsOpen the settings page
kprefix_keybindsOpen the keybind manager
bprefix_toggle_sidebarShow or hide the session rail
eprefix_exploreMove the keyboard to the rail, or back
Sprefix_session_switcherOpen the session switcher
Wprefix_workspace_switcherOpen the workspace switcher
jprefix_jump_notifJump to the pane of the newest message
Mprefix_mailOpen the agent mailbox
tprefix_windowWindow prefix
mprefix_minimizeMinimize prefix
wprefix_workspaceWorkspace prefix
Lprefix_layoutLayout prefix
Tprefix_tapeTape prefix
Dprefix_debugDebug prefix
dprefix_detachDetach. The session keeps running
Xprefix_close_sessionClose the session and its panes
Escprefix_exit_modeLeave terminal mode. Never detaches
qprefix_quitQuit. In a daemon session this kills the session
?prefix_helpToggle help

In terminal mode, pressing the leader twice sends one literal Ctrl+B to the pane.

After a command worth repeating, such as an arrow, the prefix stays armed for 500 ms. Ctrl+B then moves three panes. Change this with appearance.prefix_repeat_time. 0 turns it off.

Window prefix

Ctrl+B t, then the key. Section: [keybindings.window_prefix].

KeyActionDoes
nwindow_prefix_newNew window
xwindow_prefix_closeClose the focused window
rwindow_prefix_renameRename the focused window
Tabwindow_prefix_nextNext window
Shift+Tabwindow_prefix_prevPrevious window
twindow_prefix_tilingTurn tiling on or off
Escwindow_prefix_cancelCancel

Minimize prefix

Ctrl+B m, then the key. Section: [keybindings.minimize_prefix].

KeyActionDoes
mminimize_prefix_focusedMinimize the focused window
1 to 9minimize_prefix_restore_1 to minimize_prefix_restore_9Restore a minimized window by position
Mminimize_prefix_restore_allRestore all minimized windows
Escminimize_prefix_cancelCancel

Workspace prefix

Ctrl+B w, then the key. Section: [keybindings.workspace_prefix].

KeyActionDoes
1 to 9workspace_prefix_switch_1 to workspace_prefix_switch_9Show a workspace
! @ # $ % ^ & * (workspace_prefix_move_1 to workspace_prefix_move_9Move the focused window there and follow it
rworkspace_prefix_renameRename the current workspace
Escworkspace_prefix_cancelCancel

Layout prefix

Ctrl+B L, then the key. Section: [keybindings.layout_prefix].

KeyActionDoes
llayout_prefix_loadOpen the layout picker
slayout_prefix_saveSave the current layout as a template
1 to 4snap_corner_1 to snap_corner_4Snap to the top-left, top-right, bottom-left or bottom-right quarter. Floating mode only
5 to 9resize_width_50 to resize_width_90Set the focused window's width to 50% to 90%
Shift+5 to Shift+9resize_height_50 to resize_height_90Set its height to 50% to 90%
Esclayout_prefix_cancelCancel

Actions resize_width_10 to resize_width_40 and resize_height_10 to resize_height_40 also exist, with no default key.

Loading a layout moves the existing windows into place. It does not close any. Extra windows are minimized. tuios layout manages saved templates from the shell.

Tape prefix

Ctrl+B T, then the key. Section: [keybindings.tape_prefix]. See Tape Recording.

KeyActionDoes
mtape_prefix_managerOpen the tape manager
rtape_prefix_recordStart recording
stape_prefix_stopStop recording
ttape_prefix_reviewReview the project tape found in this directory
Esctape_prefix_cancelCancel

While a tape plays, section [keybindings.script] is active: Ctrl+P is script_pause and pauses or resumes playback.

Debug prefix

Ctrl+B D, then the key. Section: [keybindings.debug_prefix].

KeyActionDoes
ldebug_prefix_logsToggle the log viewer
cdebug_prefix_cacheToggle style cache statistics
kdebug_prefix_showkeysToggle the showkeys overlay
adebug_prefix_animationsToggle animations
Escdebug_prefix_cancelCancel

Session rail

Section: [keybindings.sidebar]. Active while the rail has the keyboard: press s in window mode, or Ctrl+B e.

KeyActionDoes
j, cursor_downMove down
k, cursor_upMove up
g, HomefirstFirst row
G, EndlastLast row
l, expandExpand the row
h, collapseCollapse the row
EnteractivateOpen the row
J, Shift+reorder_downMove the session or machine down
K, Shift+reorder_upMove the session or machine up
Tab, Shift+TabsectionGo to the next section
1 to 9jump_1 to jump_9Jump to a row by number
nnew_sessionNew session
tnew_windowNew window
rrenameRename the pane or session
caccentSet the session's accent colour
xkillOpen the row's close menu
mmenuOpen the row's menu
imailOpen the mailbox for the pane under the cursor
fagents_filterFilter the agents section
oagents_sortSort the agents section
/paletteOpen the command palette
<narrowNarrow the rail
>widenWiden the rail
?helpShow the rail's help
Esc, sexitGive the keyboard back

When the cursor is on a row in the files section, section [keybindings.sidebar_files] answers first:

KeyActionDoes
Enterfile_openOpen the folder, or copy the file's path
afile_createNew file. End the name with / for a folder
rfile_renameRename
dfile_deleteDelete to the trash
Dfile_delete_foreverDelete with no trash
yfile_copyCopy
xfile_cutCut
pfile_pastePaste into this folder

See The files section.

Copy mode

Press Ctrl+B [ to enter copy mode. It moves a cursor through the scrollback with vim keys. These keys are fixed and are not in the config. Put a count before a motion to repeat it: 10j, 5w.

KeysDoes
h j k l, arrowsMove the cursor
w b eNext word, previous word, end of word
W B EThe same, for space-separated words
0 ^ $Line start, first non-blank, line end
H M LTop, middle and bottom of the screen
gg, GTop of the scrollback, bottom (live output)
{n}GGo to line n
{ }Previous and next paragraph
%Matching bracket
Ctrl+U / Ctrl+DHalf page up, down
Ctrl+B / Ctrl+F, PgUp / PgDnFull page up, down
f F t T then a characterFind a character on the line
; ,Repeat the character search, forward or back
/ ?Search forward, backward
n NNext match, previous match
Ctrl+LClear search highlights
v VStart a character or line selection
y, cCopy the selection to the clipboard
iLeave copy mode and go to terminal mode
q, EscLeave copy mode

The scrollback browser (Ctrl+B s) is a different tool. It lists past commands by their prompt marks, for shells that emit OSC 133.

Mouse

GestureDoes
Click a paneFocus it. In window mode it also starts typing, per appearance.click_to_type
Drag a title barMove the window. In tiling, swap it with the pane you drop it on
Alt + dragMove the window from anywhere inside it (appearance.alt_drag)
Right-dragResize the window
Right-clickIn window mode, open the menu for the pane, the dock or the desktop
Shift or Ctrl + right-clickOpen the pane menu even when the program in the pane uses the mouse
Title bar buttonsMinimize, zoom or close
Click a dock itemRestore a minimized window
Wheel upEnter copy mode and scroll, when the program is not using the mouse
Drag the right borderScroll with the scrollbar
Shift + click a linkOpen it. appearance.links decides what counts as a link

In floating mode, drop a window on a screen edge to snap it: the left or right edge for a half, a corner for a quarter, the top center for the full screen.

In copy mode, a click moves the cursor and a drag selects. Dragging past the top or bottom of the pane scrolls.

Customizing

Bindings live in 19 sections under [keybindings] in config.toml. Each action takes a list of keys.

[keybindings]
leader_key = "ctrl+a"

[keybindings.window_management]
new_window = ["n", "ctrl+t"]
close_window = []          # unbind: the key goes back to the pane

An empty list and a missing line are different. A missing action gets its default back at the next load. An empty list stays empty. Key syntax and every section are on the Configuration page.

Inspect and change bindings from the shell:

tuios keybinds list                       # the main tables
tuios keybinds doctor                     # conflicts, and keys taken from the pane
tuios keybinds explain alt+left           # everything one key does
tuios keybinds unbind close_window w      # take one key off one action
tuios keybinds free alt+left              # take a key off every action

doctor tags each finding with its evidence: certain comes from TUIOS routing, observed from the live pane, reference from a list of common program defaults. doctor and explain take --json and --guest <program>.

The keybind manager (Ctrl+B k) shows the same analysis in four tabs: Bindings, Conflicts, Guests and Record. Record captures the next key you press. On a binding, Ctrl+D removes it and Ctrl+X takes its key off every action.

Keybinding edits need a new client

The config file reloads on save, but only leader_key among the keybindings. After editing other bindings, detach and attach again, or restart TUIOS. Changes made with the keybind manager apply at once.

keybinds list-custom is partial

tuios keybinds list-custom compares 9 of the 19 sections: window_management, workspaces, layout, mode_control, system, prefix_mode, window_prefix, minimize_prefix and workspace_prefix. It does not report leader_key. Use tuios keybinds doctor or read the file for the rest.

macOS

macOS treats Option as a compose key unless the terminal says otherwise. An Option chord then arrives as a character. TUIOS maps most of those characters back to the chord, which is why Option+1 to Option+9 work with no setup. Two kinds cannot be recovered:

  • Dead keys. Option+e, i, n, u and ` send nothing until a second key. Alt+n (next window in terminal mode) takes two presses.
  • Rewritten chords. Many terminals send Option+ and Option+ as readline word motions, with no sign that an arrow was pressed.

To fix both, turn on your terminal's Option-as-Alt setting:

TerminalSetting
Ghosttymacos-option-as-alt = true
Terminal.appSettings > Profiles > Keyboard > Use Option as Meta Key
iTerm2Settings > Profiles > Keys > Left Option key: Esc+
kittymacos_option_as_alt yes
WezTermsend_composed_key_when_left_alt_is_pressed = false
Alacrittyoption_as_alt = "Both" under [window]
VS Codeterminal.integrated.macOptionIsMeta

Ghostty also needs keybind = alt+left=unbind and keybind = alt+right=unbind, because its own keybinds rewrite those arrows first.

The prefix works on every terminal with no setup. Ctrl+B then an arrow, n, p, (, ), a or a digit covers every navigation command.

Command chords never reach a terminal program. macOS sends them to the menu bar.

On this page