OpenCode keyboard shortcuts
OpenCode exposes a large, remappable TUI keymap. This page covers the current default leader chords, session and model controls, message navigation, prompt editing, dialogs, and the desktop prompt layer.
Windows, macOS, Linux · 88 shortcutsLeader and app controls
Learn the leader first, then use the command list, editor, theme, sidebar, status, and exit controls around the TUI.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Leader key | CtrlX | CtrlX | CtrlX |
| Open the command list | CtrlP | CtrlP | CtrlP |
| Exit OpenCodeCtrl+X then Q is a leader sequence. Ctrl+C and Ctrl+D are direct bindings. | CtrlCorCtrlDorCtrlXQ | CtrlCorCtrlDorCtrlXQ | CtrlCorCtrlDorCtrlXQ |
| Open the external editor for the promptUses the editor in EDITOR or the configured editor. | CtrlXE | CtrlXE | CtrlXE |
| List themes | CtrlXT | CtrlXT | CtrlXT |
| Toggle the sidebar | CtrlXB | CtrlXB | CtrlXB |
| Show the status view | CtrlXS | CtrlXS | CtrlXS |
| Open the which-key help overlay | CtrlAltK | CtrlAltK | CtrlAltK |
| Change the which-key layout | CtrlAltShiftK | CtrlAltShiftK | CtrlAltShiftK |
| Toggle pending which-key display | CtrlAltShiftP | CtrlAltShiftP | CtrlAltShiftP |
Sessions and tree navigation
Create, switch, export, rename, compact, delete, and move through the current session tree without leaving the conversation.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Start a new session | CtrlXN | CtrlXN | CtrlXN |
| List sessions | CtrlXL | CtrlXL | CtrlXL |
| Export the session | CtrlXX | CtrlXX | CtrlXX |
| Show the session timeline | CtrlXG | CtrlXG | CtrlXG |
| Rename the session | CtrlR | CtrlR | CtrlR |
| Delete the session | CtrlD | CtrlD | CtrlD |
| Interrupt the current session | Esc | Esc | Esc |
| Compact the session context | CtrlXC | CtrlXC | CtrlXC |
| Jump to the first child session | CtrlXDown | CtrlXDown | CtrlXDown |
| Cycle to the next child session | Right | Right | Right |
| Cycle to the previous child session | Left | Left | Left |
| Jump to the parent session | Up | Up | Up |
Models and agents
Change the provider, model, favorite state, agent, and variant while keeping the current session in place.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| List model providers | CtrlA | CtrlA | CtrlA |
| Toggle the current model as a favorite | CtrlF | CtrlF | CtrlF |
| List models | CtrlXM | CtrlXM | CtrlXM |
| Cycle recent models forwardShift+F2 cycles recent models backward. | F2 | F2 | F2 |
| Cycle recent models backward | ShiftF2 | ShiftF2 | ShiftF2 |
| List agents | CtrlXA | CtrlXA | CtrlXA |
| Cycle agents forward | Tab | Tab | Tab |
| Cycle agents backward | ShiftTab | ShiftTab | ShiftTab |
| Cycle model variants | CtrlT | CtrlT | CtrlT |
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.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Page up through messages | PageUporCtrlAltB | PageUporCtrlAltB | PageUporCtrlAltB |
| Page down through messages | PageDownorCtrlAltF | PageDownorCtrlAltF | PageDownorCtrlAltF |
| Move up one message line | CtrlAltY | CtrlAltY | CtrlAltY |
| Move down one message line | CtrlAltE | CtrlAltE | CtrlAltE |
| Move up half a page | CtrlAltU | CtrlAltU | CtrlAltU |
| Move down half a page | CtrlAltD | CtrlAltD | CtrlAltD |
| Jump to the first message | CtrlGorHome | CtrlGorHome | CtrlGorHome |
| Jump to the last message | CtrlAltGorEnd | CtrlAltGorEnd | CtrlAltGorEnd |
| Copy the current message | CtrlXY | CtrlXY | CtrlXY |
| Undo the last message action | CtrlXU | CtrlXU | CtrlXU |
| Redo the last message action | CtrlXR | CtrlXR | CtrlXR |
| Toggle concealed message details | CtrlXH | CtrlXH | CtrlXH |
Prompt editing
Edit the prompt with Readline-style movement, selection, deletion, undo, redo, history, and multiline input controls.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Clear the prompt | CtrlC | CtrlC | CtrlC |
| Paste into the prompt | CtrlV | CtrlV | CtrlV |
| Submit the prompt | Enter | Enter | Enter |
| Insert a newline without submittingSome terminals need explicit Shift+Enter configuration. | ShiftEnterorCtrlEnterorAltEnterorCtrlJ | ShiftEnterorCtrlEnterorAltEnterorCtrlJ | ShiftEnterorCtrlEnterorAltEnterorCtrlJ |
| Move left one character | LeftorCtrlB | LeftorCtrlB | LeftorCtrlB |
| Move right one character | RightorCtrlF | RightorCtrlF | RightorCtrlF |
| Move up one prompt line | Up | Up | Up |
| Move down one prompt line | Down | Down | Down |
| Move to the start of the line | CtrlA | CtrlA | CtrlA |
| Move to the end of the line | CtrlE | CtrlE | CtrlE |
| Move to the start of the prompt | Home | Home | Home |
| Move to the end of the prompt | End | End | End |
| Select left one character | ShiftLeft | ShiftLeft | ShiftLeft |
| Select right one character | ShiftRight | ShiftRight | ShiftRight |
| Select to the start of the line | CtrlShiftA | CtrlShiftA | CtrlShiftA |
| Select to the end of the line | CtrlShiftE | CtrlShiftE | CtrlShiftE |
| Delete the current line | CtrlShiftD | CtrlShiftD | CtrlShiftD |
| Delete to the end of the line | CtrlK | CtrlK | CtrlK |
| Delete to the start of the line | CtrlU | CtrlU | CtrlU |
| Delete the previous character | BackspaceorShiftBackspace | BackspaceorShiftBackspace | BackspaceorShiftBackspace |
| Delete the next character | CtrlDorDeleteorShiftDelete | CtrlDorDeleteorShiftDelete | CtrlDorDeleteorShiftDelete |
| Undo prompt editingSuper is the platform's Super or Command key. | Ctrl-orSuperZ | Ctrl-orSuperZ | Ctrl-orSuperZ |
| Redo prompt editingSuper is the platform's Super or Command key. | Ctrl.orSuperShiftZ | Ctrl.orSuperShiftZ | Ctrl.orSuperShiftZ |
| Move forward one word | AltForAltRightorCtrlRight | AltForAltRightorCtrlRight | AltForAltRightorCtrlRight |
| Move backward one word | AltBorAltLeftorCtrlLeft | AltBorAltLeftorCtrlLeft | AltBorAltLeftorCtrlLeft |
| Delete the next word | AltDorAltDeleteorCtrlDelete | AltDorAltDeleteorCtrlDelete | AltDorAltDeleteorCtrlDelete |
| Delete the previous word | CtrlWorCtrlBackspaceorAltBackspace | CtrlWorCtrlBackspaceorAltBackspace | CtrlWorCtrlBackspaceorAltBackspace |
| Select all prompt textSuper is the platform's Super or Command key. | SuperA | SuperA | SuperA |
| Previous prompt history entry | Up | Up | Up |
| Next prompt history entry | Down | Down | Down |
Dialogs, completion, and terminal
Move through selection dialogs, accept completions, handle permissions, and use the terminal controls that surround the TUI.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Previous dialog item | UporCtrlP | UporCtrlP | UporCtrlP |
| Next dialog item | DownorCtrlN | DownorCtrlN | DownorCtrlN |
| Page up in a dialog | PageUp | PageUp | PageUp |
| Page down in a dialog | PageDown | PageDown | PageDown |
| Jump to the first dialog item | Home | Home | Home |
| Jump to the last dialog item | End | End | End |
| Confirm a dialog selection | Enter | Enter | Enter |
| Toggle an MCP selection | Space | Space | Space |
| Previous autocomplete item | UporCtrlP | UporCtrlP | UporCtrlP |
| Next autocomplete item | DownorCtrlN | DownorCtrlN | DownorCtrlN |
| Hide autocomplete | Esc | Esc | Esc |
| Select the autocomplete item | Enter | Enter | Enter |
| Complete the current token | Tab | Tab | Tab |
| Open a permission prompt full-screen | CtrlF | CtrlF | CtrlF |
| Suspend OpenCode to the shellThe current docs disable terminal suspension on Windows; use fg to resume on Unix-like systems. | Not documented | CtrlZ | CtrlZ |