OpenCode keyboard shortcuts

OpenCode is an open source AI coding agent that runs in your terminal. Most of its keys start with a leader key, and they cover sessions, switching models and agents, scrolling through replies, editing the prompt, and dialogs.

Windows, macOS, Linux · 88 shortcuts

Leader and app controls

Learn the leader first, then use the command list, editor, theme, sidebar, status, and exit controls around the TUI.

ActionShortcuts
Leader key
Windows / macOS / LinuxCtrl + X
Open the command list
Windows / macOS / LinuxCtrl + P
Exit OpenCodeCtrl+X then Q is a leader sequence. Ctrl+C and Ctrl+D are direct bindings.
Windows / macOS / LinuxCtrl + CorCtrl + DorCtrl + X then Q
Open the external editor for the promptUses the editor in EDITOR or the configured editor.
Windows / macOS / LinuxCtrl + X then E
List themes
Windows / macOS / LinuxCtrl + X then T
Show the status view
Windows / macOS / LinuxCtrl + X then S
Open the which-key help overlay
Windows / macOS / LinuxCtrl + Alt + K
Change the which-key layout
Windows / macOS / LinuxCtrl + Alt + Shift + K
Toggle pending which-key display
Windows / macOS / LinuxCtrl + Alt + Shift + P

Sessions and tree navigation

Create, switch, export, rename, compact, delete, and move through the current session tree without leaving the conversation.

ActionShortcuts
Start a new session
Windows / macOS / LinuxCtrl + X then N
List sessions
Windows / macOS / LinuxCtrl + X then L
Export the session
Windows / macOS / LinuxCtrl + X then X
Show the session timeline
Windows / macOS / LinuxCtrl + X then G
Rename the session
Windows / macOS / LinuxCtrl + R
Delete the session
Windows / macOS / LinuxCtrl + D
Interrupt the current session
Windows / macOS / LinuxEsc
Compact the session context
Windows / macOS / LinuxCtrl + X then C
Jump to the first child session
Windows / macOS / LinuxCtrl + X then Down
Cycle to the next child session
Windows / macOS / LinuxRight
Cycle to the previous child session
Windows / macOS / LinuxLeft
Jump to the parent session
Windows / macOS / LinuxUp

Models and agents

Change the provider, model, favorite state, agent, and variant while keeping the current session in place.

ActionShortcuts
List model providers
Windows / macOS / LinuxCtrl + A
Toggle the current model as a favorite
Windows / macOS / LinuxCtrl + F
List models
Windows / macOS / LinuxCtrl + X then M
Cycle recent models forwardShift+F2 cycles recent models backward.
Windows / macOS / LinuxF2
Cycle recent models backward
Windows / macOS / LinuxShift + F2
List agents
Windows / macOS / LinuxCtrl + X then A
Cycle agents forward
Windows / macOS / LinuxTab
Cycle agents backward
Windows / macOS / LinuxShift + Tab
Cycle model variants
Windows / macOS / LinuxCtrl + T

Messages and response history

Move through long responses, jump to the first or last message, copy or undo message state, and change how details are shown.

ActionShortcuts
Page up through messages
Windows / macOS / LinuxPageUporCtrl + Alt + B
Page down through messages
Windows / macOS / LinuxPageDownorCtrl + Alt + F
Move up one message line
Windows / macOS / LinuxCtrl + Alt + Y
Move down one message line
Windows / macOS / LinuxCtrl + Alt + E
Move up half a page
Windows / macOS / LinuxCtrl + Alt + U
Move down half a page
Windows / macOS / LinuxCtrl + Alt + D
Jump to the first message
Windows / macOS / LinuxCtrl + GorHome
Jump to the last message
Windows / macOS / LinuxCtrl + Alt + GorEnd
Copy the current message
Windows / macOS / LinuxCtrl + X then Y
Undo the last message action
Windows / macOS / LinuxCtrl + X then U
Redo the last message action
Windows / macOS / LinuxCtrl + X then R
Toggle concealed message details
Windows / macOS / LinuxCtrl + X then H

Prompt editing

Edit the prompt with Readline-style movement, selection, deletion, undo, redo, history, and multiline input controls.

ActionShortcuts
Clear the prompt
Windows / macOS / LinuxCtrl + C
Paste into the prompt
Windows / macOS / LinuxCtrl + V
Submit the prompt
Windows / macOS / LinuxEnter
Insert a newline without submittingSome terminals need explicit Shift+Enter configuration.
Windows / macOS / LinuxShift + EnterorCtrl + EnterorAlt + EnterorCtrl + J
Move left one character
Windows / macOS / LinuxLeftorCtrl + B
Move right one character
Windows / macOS / LinuxRightorCtrl + F
Move up one prompt line
Windows / macOS / LinuxUp
Move down one prompt line
Windows / macOS / LinuxDown
Move to the start of the line
Windows / macOS / LinuxCtrl + A
Move to the end of the line
Windows / macOS / LinuxCtrl + E
Move to the start of the prompt
Windows / macOS / LinuxHome
Move to the end of the prompt
Windows / macOS / LinuxEnd
Select left one character
Windows / macOS / LinuxShift + Left
Select right one character
Windows / macOS / LinuxShift + Right
Select to the start of the line
Windows / macOS / LinuxCtrl + Shift + A
Select to the end of the line
Windows / macOS / LinuxCtrl + Shift + E
Delete the current line
Windows / macOS / LinuxCtrl + Shift + D
Delete to the end of the line
Windows / macOS / LinuxCtrl + K
Delete to the start of the line
Windows / macOS / LinuxCtrl + U
Delete the previous character
Windows / macOS / LinuxBackspaceorShift + Backspace
Delete the next character
Windows / macOS / LinuxCtrl + DorDeleteorShift + Delete
Undo prompt editingSuper is the platform's Super or Command key.
Windows / macOS / LinuxCtrl + -orSuper + Z
Redo prompt editingSuper is the platform's Super or Command key.
Windows / macOS / LinuxCtrl + .orSuper + Shift + Z
Move forward one word
Windows / macOS / LinuxAlt + ForAlt + RightorCtrl + Right
Move backward one word
Windows / macOS / LinuxAlt + BorAlt + LeftorCtrl + Left
Delete the next word
Windows / macOS / LinuxAlt + DorAlt + DeleteorCtrl + Delete
Delete the previous word
Windows / macOS / LinuxCtrl + WorCtrl + BackspaceorAlt + Backspace
Select all prompt textSuper is the platform's Super or Command key.
Windows / macOS / LinuxSuper + A
Previous prompt history entry
Windows / macOS / LinuxUp
Next prompt history entry
Windows / macOS / LinuxDown

Dialogs, completion, and terminal

Move through selection dialogs, accept completions, handle permissions, and use the terminal controls that surround the TUI.

ActionShortcuts
Previous dialog item
Windows / macOS / LinuxUporCtrl + P
Next dialog item
Windows / macOS / LinuxDownorCtrl + N
Page up in a dialog
Windows / macOS / LinuxPageUp
Page down in a dialog
Windows / macOS / LinuxPageDown
Jump to the first dialog item
Windows / macOS / LinuxHome
Jump to the last dialog item
Windows / macOS / LinuxEnd
Confirm a dialog selection
Windows / macOS / LinuxEnter
Toggle an MCP selection
Windows / macOS / LinuxSpace
Previous autocomplete item
Windows / macOS / LinuxUporCtrl + P
Next autocomplete item
Windows / macOS / LinuxDownorCtrl + N
Hide autocomplete
Windows / macOS / LinuxEsc
Select the autocomplete item
Windows / macOS / LinuxEnter
Complete the current token
Windows / macOS / LinuxTab
Open a permission prompt full-screen
Windows / macOS / LinuxCtrl + F
Suspend OpenCode to the shellThe current docs disable terminal suspension on Windows; use fg to resume on Unix-like systems.
WindowsNot documented
macOS / LinuxCtrl + Z

Source

official OpenCode keybinds reference · Checked

Current default keybinds from opencode.ai, last updated August 25, 2026. The leader is Ctrl+X, leader chords are sequential, and every TUI binding can be remapped in tui.json.

Make a printable OpenCode sheet