Pi Agent Keyboard Shortcut Customization

Pi Agent's shortcuts are fully customizable. This chapter introduces the default shortcut configuration and how to create your own shortcut scheme.


Configuration File

The shortcut configuration file is located at~/.pi/agent/keybindings.json。

After modification, run/reloadto take effect without restarting.


Shortcut Format

The shortcut format isModifier+KeyModifier keys include ctrl, shift, alt, and super, which can be combined.

Among them, super only works if the terminal can report this modifier key separately (usually relying on the Kitty keyboard protocol); it may not work in unsupported terminals.

Supported keys are divided into the following categories:

CategoryValueExample
Lettersa-zctrl+b、alt+d
Numbers0-9alt+1
Function keysf1-f12f2
Arrow keysup、down、left、rightalt+left
Special keysescape、enter、tab、space、backspace、delete、home、end、pageUp、pageDownshift+enter
Symbols` - = [ ] ; ' , . / etc.ctrl+]、ctrl+-

In the configuration file, modifier keys are written in lowercase (e.g., ctrl+shift+p), while tables in the text are usually written as Shift+Ctrl+P; the two are equivalent.


Default Shortcut Quick Reference

The following four tables list the factory default bindings by functional area, serving as a baseline for customization.

This chapter only lists common bindings; ctrl+], ctrl+alt+], pageUp/pageDown, alt+y, ctrl+z, and session selector keys are not included. The full list can be viewed with /hotkeys in interactive mode.

Editor Operations

This group only takes effect in the editor area, handling cursor movement and text deletion.

OperationDefault ShortcutDescriptionMode
Move cursor upupMove the cursor up in the editor; when at the top, browse earlier history instead.Editor area
Move cursor downdownMove the cursor down in the editor; when at the bottom, browse newer history instead.Editor area
Move cursor leftleft, ctrl+bMove left by one character.Editor area
Move cursor rightright, ctrl+fMove right by one character.Editor area
Move left by wordalt+left, ctrl+left, alt+bMove left by one word.Editor area
Move right by wordalt+right, ctrl+right, alt+fMove right by one word.Editor area
Start of linehome, ctrl+home, ctrl+aJump to the start of the line.Editor area
End of lineend, ctrl+end, ctrl+eJump to the end of the line.Editor area
Delete previous characterbackspaceDelete the character before the cursor.Editor area
Delete next characterdelete, ctrl+dDelete the character after the cursor (an editing action).Editor area
Delete previous wordctrl+w, alt+backspaceDelete the word before the cursor.Editor area
Delete next wordalt+d, alt+deleteDelete the word after the cursor.Editor area
Delete to start of linectrl+uDelete content from the cursor to the start of the line.Editor area
Delete to end of linectrl+kDelete content from the cursor to the end of the line.Editor area

Input and Submission

This group controls how content is wrapped, completed, and submitted, and also applies to the editor area.

OperationDefault ShortcutDescriptionMode
Newlineshift+enter, ctrl+jInsert a newline character.Editor area
SubmitenterSend the input content.Editor area
Tab / Auto-completiontabTrigger path auto-completion.Editor area
Undoctrl+-Undo the last editing step.Editor area
Paste deleted textctrl+yPaste the most recently deleted text.Editor area

Application and Messages

This group is responsible for interrupting the AI, managing editor content and the message queue, and mostly does not depend on editor focus.

OperationDefault ShortcutDescriptionMode
Interrupt / CancelescapeCancel the current AI operation.Global
Clear editor areactrl+cClear the editor content; press again to exit the program.Editor area
Exitctrl+dExit the program when the editor is empty (this belongs to the app.exit action, separate from the deletion actions in the previous table).Editor area
External editorctrl+gEdit the current input in an external editor.Editor area
Paste imagectrl+vPaste an image from the clipboard (Windows: alt+v).Editor area
Copy AI replyctrl+xCopy the last AI message.Editor area
Send follow-up messagealt+enterQueue the message into the follow-up queue.Editor area
Retrieve queued messagealt+upBring the queued message back to the editor.Editor area

Model and Reasoning

This group is used to switch models and adjust reasoning behavior, and is available at any time during a conversation.

OperationDefault ShortcutDescriptionMode
Model selectorctrl+lOpen the model selector.Global
Switch model forwardctrl+pSwitch to the next model.Global
Switch model backwardshift+ctrl+pSwitch to the previous model.Global
Toggle reasoning levelshift+tabCycle through reasoning levels.Editor area
Toggle reasoning displayctrl+tExpand/collapse the AI reasoning process.Global
Toggle tool outputctrl+oExpand/collapse tool call output.Global (in the /tree browser, toggles filter mode)

Custom Shortcut Configuration

Simply list the operations you want to override in keybindings.json; operations not listed retain their defaults.

Set a binding's value to an empty array, for example"tui.altScreen.pageUp": []to completely disable that shortcut.

Emacs Style

If you are used to Emacs shortcuts, you can~/.pi/agent/keybindings.jsonuse the following configuration in:

Example

{
  "tui.editor.historyPrevious": "ctrl+p",
  "tui.editor.historyNext": "ctrl+n",
  "tui.editor.cursorUp": ["up"],
  "tui.editor.cursorDown": ["down"],
  "tui.editor.cursorLeft": ["left", "ctrl+b"],
  "tui.editor.cursorRight": ["right", "ctrl+f"],
  "tui.editor.cursorWordLeft": ["alt+left", "alt+b"],
  "tui.editor.cursorWordRight": ["alt+right", "alt+f"],
  "tui.editor.deleteCharForward": ["delete", "ctrl+d"],
  "tui.editor.deleteCharBackward": ["backspace", "ctrl+h"],
  "tui.input.newLine": ["shift+enter", "ctrl+j"]
}

The two history actions historyPrevious and historyNext are not bound by default; they are specifically for browsing submission history, and they also switch history entries in multiline input.

After binding ctrl+p to the previous history item, when the editor area gains focus, Ctrl+P will be preempted by this history binding, and forward model switching temporarily becomes ineffective in this scenario.

Ctrl+P in selection lists such as the model selector is not affected and still performs the selector's own action.

Vim Style

If you are used to Vim's arrow keys, you can use the following configuration:

Example

{
  "tui.editor.cursorUp": ["up", "alt+k"],
  "tui.editor.cursorDown": ["down", "alt+j"],
  "tui.editor.cursorLeft": ["left", "alt+h"],
  "tui.editor.cursorRight": ["right", "alt+l"],
  "tui.editor.cursorWordLeft": ["alt+left", "alt+b"],
  "tui.editor.cursorWordRight": ["alt+right", "alt+w"]
}

Here, alt+h/j/k/l are chosen to avoid built-in bindings such as Ctrl+H and Ctrl+D, so the Alt series is used.

Pi Agent's shortcut configuration overrides the default values.

Each operation can be bound to one or more shortcuts.

Operations not listed in the configuration file retain their default shortcuts.


View All Shortcuts

In interactive mode, use the following command to display all shortcuts and their current bindings:

/hotkeys

Example output:

编辑器
  tui.editor.cursorUp            up
  tui.editor.cursorDown          down
  tui.editor.cursorWordLeft      alt+left, ctrl+left, alt+b
  tui.input.submit               enter
模型与推理
  app.model.select               ctrl+l
  app.model.cycleForward         ctrl+p
  app.model.cycleBackward        shift+ctrl+p

Shortcut operations use namespaced IDs in the format "module.action".

IDs without namespaces in older config files (such as cursorUp, expandTools) will be automatically migrated to namespaced IDs at startup; no manual modification required.

This command lists all available shortcut actions, current bindings, and their associated feature areas, making it the best way to troubleshoot keybinding conflicts or find the shortcut for a specific feature.


Keys in Fullscreen Mode

use--tui-mode fullscreenAt startup, the transcript scrolls within the terminal viewport, while the editor and bottom status area remain fixed.

At this point, home, end, pageUp, and pageDown without modifier keys are used to scroll the transcript, while their ctrl variants still belong to the editor.

In normal mode, both sets of keys act on the editor.

Fullscreen mode also has dedicated search and navigation: ctrl+shift+f searches the transcript, and ctrl+up / ctrl+down jump between the previous and next marked messages.

Fullscreen scroll bindings take precedence over editor bindings and can still be adjusted through normal action bindings.

KeysNormal modeFullscreen mode
home、endEditorScroll transcript
ctrl+home、ctrl+endEditorEditor
pageUp、pageDownEditorScroll transcript
ctrl+pageUp、ctrl+pageDownEditorEditor
ctrl+shift+f (ctrl+f on Windows/WSL)Not in effectSearch transcript
ctrl+up、ctrl+downNot in effectJump to previous/next marked message
Other extensions