LatentCodeCustomize

Keybindings

Every TUI shortcut, its default keys, and how to change them.

The leader key

Most shortcuts start with the leader key, ctrl+x. Press it, let go, then press the next key within two seconds: ctrl+x n starts a new session. In the tables below, those are shown as ctrl+x followed by the key.

ctrl+p opens the command palette, which lists every action with its current shortcut. It's the quickest way to find something.

Change a shortcut

Set keybindings in tui.json (not latentcode.json), globally in ~/.config/latentcode/tui.json or per project. Use the names from the tables below.

~/.config/latentcode/tui.json
{
  "$schema": "https://latentstack.dev/tui.json",
  "keybinds": {
    "leader": "ctrl+a",
    "session_new": "<leader>n,ctrl+n",
    "input_newline": "shift+return,ctrl+j",
    "messages_toggle_conceal": "none"
  },
  "leader_timeout": 3000
}
  • Separate alternatives with commas. Each one works.
  • Write <leader> to use the leader key, whatever you've set it to.
  • Set a binding to "none" (or false) to turn it off.
  • Write keys the way the defaults below do, for example ctrl+shift+a, alt+return or pagedown. enter, esc, pgup and pgdown are accepted as other names for return, escape, pageup and pagedown.
  • leader_timeout is how long, in milliseconds, LatentCode waits for the key after the leader. Default 2000.
  • Unknown names are ignored with a warning in the log.
Terminals don't send every key
Many terminals can't tell shift+return from return, and on macOS the Option key often doesn't act as alt unless you turn that on in the terminal's settings. If a shortcut does nothing, try one of its alternatives (ctrl+j always inserts a newline) or bind a different key.

Defaults

Some keys mean different things in different places. ctrl+d, for example, quits from an empty prompt, deletes a character while you type, and deletes the selected session in the session list.

General

NameDefaultAction
app_exitctrl+cctrl+dctrl+xqExit the application
app_toggle_animationsnoneToggle animations
app_toggle_file_contextnoneToggle file context
app_toggle_diffwrapnoneToggle diff wrapping
app_toggle_paste_summarynoneToggle paste summary
app_toggle_session_directory_filternoneToggle session directory filtering
command_listctrl+pList available commands
help_shownoneOpen help dialog
docs_opennoneOpen documentation
editor_openctrl+xeOpen external editor
theme_listctrl+xtList available themes
theme_switch_modenoneSwitch between light and dark theme mode
theme_mode_locknoneLock or unlock theme mode
sidebar_togglectrl+xbToggle sidebar
scrollbar_togglenoneToggle session scrollbar
status_viewctrl+xsView status
terminal_suspendctrl+zSuspend terminal
terminal_title_togglenoneToggle terminal title
plugin_managernoneOpen plugin manager dialog
plugin_installnoneInstall plugin

Sessions

escape interrupts the agent only when pressed twice: the prompt shows esc again to interrupt after the first press. session_rename, session_delete and session_pin_toggle act in the session list.

NameDefaultAction
session_exportctrl+xxExport session to editor
session_copynoneCopy session transcript
session_newctrl+xnCreate a new session
session_listctrl+xlList all sessions
session_timelinectrl+xgShow session timeline
session_forknoneFork session from message
session_renamectrl+rRename session
session_deletectrl+dDelete session
session_interruptescapeInterrupt current session
loop_stopescapeStop the active loop while waiting
session_backgroundctrl+bBackground synchronous subagents
session_compactctrl+xcCompact the session
session_toggle_timestampsnoneToggle message timestamps
session_toggle_generic_tool_outputnoneToggle generic tool output
session_child_firstctrl+xdownGo to first child session
session_child_cyclerightGo to next child session
session_child_cycle_reverseleftGo to previous child session
session_parentupGo to parent session
session_pin_togglectrl+fPin or unpin session in the session list
session_quick_switch_1ctrl+x1Switch to session in quick slot 1
session_quick_switch_2ctrl+x2Switch to session in quick slot 2
session_quick_switch_3ctrl+x3Switch to session in quick slot 3
session_quick_switch_4ctrl+x4Switch to session in quick slot 4
session_quick_switch_5ctrl+x5Switch to session in quick slot 5
session_quick_switch_6ctrl+x6Switch to session in quick slot 6
session_quick_switch_7ctrl+x7Switch to session in quick slot 7
session_quick_switch_8ctrl+x8Switch to session in quick slot 8
session_quick_switch_9ctrl+x9Switch to session in quick slot 9

Models and agents

NameDefaultAction
model_favorite_togglectrl+fToggle model favorite status
model_listctrl+xmList available models
model_cycle_recentf2Next recently used model
model_cycle_recent_reverseshift+f2Previous recently used model
model_cycle_favoritenoneNext favorite model
model_cycle_favorite_reversenonePrevious favorite model
mcp_listnoneList MCP servers
provider_connectnoneConnect provider
agent_listctrl+xaList agents
agent_cycletabNext agent
agent_cycle_reverseshift+tabPrevious agent
variant_cyclectrl+tCycle reasoning effort
variant_listnoneList reasoning effort levels

Conversation

NameDefaultAction
messages_page_uppageupctrl+alt+bScroll messages up by one page
messages_page_downpagedownctrl+alt+fScroll messages down by one page
messages_line_upctrl+alt+yScroll messages up by one line
messages_line_downctrl+alt+eScroll messages down by one line
messages_half_page_upctrl+alt+uScroll messages up by half page
messages_half_page_downctrl+alt+dScroll messages down by half page
messages_firstctrl+ghomeNavigate to first message
messages_lastctrl+alt+gendNavigate to last message
messages_nextnoneNavigate to next message
messages_previousnoneNavigate to previous message
messages_last_usernoneNavigate to last user message
messages_copyctrl+xyCopy message
messages_undoctrl+xuUndo message
messages_redoctrl+xrRedo message
messages_toggle_concealctrl+xhToggle code block concealment in messages
tool_detailsnoneToggle tool details visibility
display_thinkingnoneToggle thinking blocks visibility
display_detailctrl+lExpand or collapse reasoning, summaries and tool activity

Prompt and text editing

NameDefaultAction
stash_deletectrl+dDelete stash entry
prompt_submitnoneSubmit prompt
prompt_editor_context_clearnoneClear editor context
prompt_skillsnoneOpen skill selector
prompt_stashnoneStash prompt
prompt_stash_popnonePop stashed prompt
prompt_stash_listnoneList stashed prompts
prompt_paste_previewctrl+oPreview pasted content
input_clearctrl+cClear input field
input_pastectrl+vPaste from clipboard
input_submitreturnSubmit input
input_newlineshift+returnctrl+returnalt+returnctrl+jInsert newline in input
input_move_leftleftctrl+bMove cursor left in input
input_move_rightrightctrl+fMove cursor right in input
input_move_upupMove cursor up in input
input_move_downdownMove cursor down in input
input_select_leftshift+leftSelect left in input
input_select_rightshift+rightSelect right in input
input_select_upshift+upSelect up in input
input_select_downshift+downSelect down in input
input_line_homectrl+aMove to start of line in input
input_line_endctrl+eMove to end of line in input
input_select_line_homectrl+shift+aSelect to start of line in input
input_select_line_endctrl+shift+eSelect to end of line in input
input_visual_line_homealt+aMove to start of visual line in input
input_visual_line_endalt+eMove to end of visual line in input
input_select_visual_line_homealt+shift+aSelect to start of visual line in input
input_select_visual_line_endalt+shift+eSelect to end of visual line in input
input_buffer_homehomeMove to start of buffer in input
input_buffer_endendMove to end of buffer in input
input_select_buffer_homeshift+homeSelect to start of buffer in input
input_select_buffer_endshift+endSelect to end of buffer in input
input_delete_linectrl+shift+dDelete line in input
input_delete_to_line_endctrl+kDelete to end of line in input
input_delete_to_line_startctrl+uDelete to start of line in input
input_backspacebackspaceshift+backspaceBackspace in input
input_deletectrl+ddeleteshift+deleteDelete character in input
input_undoctrl+-super+zUndo in input
input_redoctrl+.super+shift+zRedo in input
input_word_forwardalt+falt+rightctrl+rightMove word forward in input
input_word_backwardalt+balt+leftctrl+leftMove word backward in input
input_select_word_forwardalt+shift+falt+shift+rightSelect word forward in input
input_select_word_backwardalt+shift+balt+shift+leftSelect word backward in input
input_delete_word_forwardalt+dalt+deletectrl+deleteDelete word forward in input
input_delete_word_backwardctrl+wctrl+backspacealt+backspaceDelete word backward in input
input_select_allsuper+aSelect all in input
history_previousupPrevious history item
history_nextdownNext history item

Lists, autocomplete and dialogs

NameDefaultAction
dialog.select.prevupctrl+pMove to previous dialog item
dialog.select.nextdownctrl+nMove to next dialog item
dialog.select.page_uppageupMove up one page in dialog
dialog.select.page_downpagedownMove down one page in dialog
dialog.select.homehomeMove to first dialog item
dialog.select.endendMove to last dialog item
dialog.select.submitreturnSubmit selected dialog item
dialog.prompt.submitreturnSubmit dialog prompt
dialog.mcp.togglespaceToggle MCP in MCP dialog
prompt.autocomplete.prevupctrl+pMove to previous autocomplete item
prompt.autocomplete.nextdownctrl+nMove to next autocomplete item
prompt.autocomplete.hideescapeHide autocomplete
prompt.autocomplete.selectreturnSelect autocomplete item
prompt.autocomplete.completetabComplete autocomplete item
permission.prompt.fullscreenctrl+fToggle permission prompt fullscreen
plugins.togglespaceToggle plugin
dialog.plugins.installshift+iInstall plugin from plugin dialog

Diff viewer

These apply inside the diff viewer (/diff). It also uses fixed keys you can't change: j/down and k/up to move, pagedown/ctrl+f and pageup/ctrl+b to page, and m to mark a file reviewed.

NameDefaultAction
diff_closeescapeqClose diff viewer
diff_toggleenterspaceToggle diff viewer item
diff_expandrightExpand diff viewer item
diff_expand_allEExpand all diff viewer folders
diff_collapseleftCollapse diff viewer item
diff_switch_focustabSwitch diff viewer focus
diff_next_hunk]Jump to next diff hunk
diff_previous_hunk[Jump to previous diff hunk
diff_next_filenJump to next diff file
diff_previous_filepJump to previous diff file
diff_toggle_file_treebToggle diff viewer file tree
diff_single_patchsToggle single patch view
diff_switch_sourcedSwitch diff viewer source
diff_toggle_viewvToggle diff viewer split or unified view
diff_help?Show more diff viewer shortcuts

Windows

On Windows, terminal_suspend is turned off and ctrl+z is added to input_undo, unless you set those yourself.

See also The TUI for what each part of the screen does.