# Keys
## The keybindings file
`~/.pic/keybindings.json` in Pi's format (`{"app.exit": "ctrl+q", "tui.input.newLine":
["shift+enter", "ctrl+j"], "app.suspend": []}`) uses Pi's 90 action names (plus pic's
`app.screen.redraw`, `app.history.search`, `app.credential.select`, `app.mouse.toggle` and
`app.settings.open`) and key syntax, with Pi's defaults except the
Mac-friendly ones below (`ctrl+shift+x`, `alt+enter`, `pageUp`, `f5`, `super+k`; a value replaces
the action's defaults and `[]` disables it; Pi's older action names are migrated). `/hotkeys` shows
the effective bindings. pic warns about an invalid key (the action keeps its default), an unknown
action, and a key two actions claim (Pi detects the conflict but shows no message). Actions that
need views pic does not have (the session and model list filters, tree navigation, semantic-prompt
jumps) are accepted and do nothing. Alt+letter chords need the letter to be bound in the file
(otherwise Esc followed by the letter is typed as before). `/reload` re-reads the keybindings file.
## Defaults that differ from Pi
Pi's defaults assume keys a stock macOS Terminal or iTerm2 does not send (no End key, Option is not
Meta, Shift+Ctrl chords are lost). Where that bites, pic's default is the key Claude Code uses for
the same job, and Pi's stays as an alternate where it can; everything is overridable in
`keybindings.json`.
| Action | pic default | Pi's | Why (source) |
|---|---|---|---|
| `tui.input.newLine` | Shift+Enter, Ctrl+J, and `\` then Enter | Shift+Enter, Ctrl+J | Claude Code's backslash-Enter works in every terminal |
| `app.message.followUp` | Ctrl+Q, Alt+Enter | Alt+Enter | Alt+Enter needs Option as Meta; Claude Code has no follow-up, Ctrl+Q is free and sendable |
| `app.message.dequeue` | Alt+Up, and Up from the editor's first line | Alt+Up | Claude Code pulls queued messages back with Up |
| `app.model.select` | Alt+P | Ctrl+L | Ctrl+L redraws in Claude Code; Option+P is its model picker (`/model` and Ctrl+P cycling work too) |
| `app.screen.redraw` (pic's) | Ctrl+L | | Claude Code's Ctrl+L |
| `app.exit` | Ctrl+D twice within 800 ms, on an empty editor | Ctrl+D once | Claude Code asks for the second press and says so ("press ctrl+d again to exit"); with text in the editor Ctrl+D still deletes forward |
| `app.history.search` (pic's) | Ctrl+R | | Claude Code's Ctrl+R over this conversation's prompts (those of a resumed one included, and in a new one this folder's earlier prompts): type to filter (case-insensitive), Ctrl+R again for an older match, Enter takes the match into the editor (it is not sent), Esc cancels |
| `app.credential.select` (pic's) | none | | `/auth`; bound to no key, since it opens by its slash command |
| `app.mouse.toggle` (pic's) | Alt+M | | turns fullscreen mouse capture off and on for the session (`/mouse`); M for mouse, and Alt+M is free in Pi's defaults |
| `app.settings.open` (pic's) | F2 | | opens and closes the [settings panel](../manual/settings-panel.md) over anything, a running reply included (`/settings`); Cmd+, never reaches a terminal program, and every Ctrl letter is taken |
| `app.thinking.cycle` | Shift+Tab, Alt+T | Shift+Tab | Option+T is Claude Code's thinking toggle |
| `app.model.cycleBackward` | Shift+Ctrl+P, Ctrl+N | Shift+Ctrl+P | terminals drop the Shift on a Ctrl chord |
| `tui.altScreen.pageUp`/`pageDown` | PageUp/PageDown, Shift+Up/Shift+Down | PageUp/PageDown | Mac keyboards reach PageUp as Fn+Up, which not every terminal passes |
| `tui.altScreen.top`/`bottom` | Ctrl+Home/Ctrl+End, Shift+PageUp/Shift+PageDown, Ctrl+Shift+Up/Ctrl+Shift+Down | Ctrl+Home/Ctrl+End | A Mac keyboard has no End or PageDown key (Fn+Right, Fn+Down), macOS takes Ctrl+Fn+Right for Spaces, and Ghostty and Terminal.app take Shift+PageDown for their own scrollback; no Mac terminal or macOS shortcut takes Ctrl+Shift+Down. The jump-to-latest button names no key. Clicking it, or typing or pressing Enter while scrolled up, also jumps to the latest message |
| Esc twice on an empty editor | `/rewind` | `/tree` | Claude Code's Esc Esc rewinds; the setting `doubleEscapeAction` takes Pi's `tree` (or `fork`, `none`) back |
| `tui.altScreen.search` | Shift+Ctrl+F, Ctrl+F | Shift+Ctrl+F (Ctrl+F on Windows) | Mac Terminal sends no Shift+Ctrl+F; Ctrl+F is also `tui.editor.cursorRight`: in fullscreen it opens the search (Right still moves the cursor), in regular mode it stays cursor right |
## Every action
Generated from `src/tui/keymap.c` by `sh test/pic/docs.sh --keys`; `make test-docs` fails when this
table and the code differ. The keys are the defaults on macOS; `/hotkeys` shows the bindings in
effect, your `keybindings.json` included.
<!-- keys:begin -->
| Action | Default keys | What it does |
|---|---|---|
| `app.interrupt` | escape | Cancel or abort |
| `app.clear` | ctrl+c | Clear editor |
| `app.exit` | ctrl+d | Exit when editor is empty |
| `app.suspend` | ctrl+z | Suspend to background |
| `app.thinking.cycle` | shift+tab, alt+t | Cycle thinking level |
| `app.thinking.save` | ctrl+s | Save thinking level |
| `app.model.cycleForward` | ctrl+p | Cycle to next model |
| `app.model.cycleBackward` | shift+ctrl+p, ctrl+n | Cycle to previous model |
| `app.model.select` | alt+p | Open model selector |
| `app.credential.select` | none | Open /auth (pic; no key unless bound) |
| `app.mouse.toggle` | alt+m | Capture the mouse or leave it to the terminal (pic) |
| `app.settings.open` | f2 | Open or close the settings panel (pic) |
| `app.history.search` | ctrl+r | Search prompt history (pic; Claude Code's Ctrl+R) |
| `app.screen.redraw` | ctrl+l | Redraw the screen (pic; Claude Code's Ctrl+L) |
| `app.tools.expand` | ctrl+o | Toggle tool output |
| `app.thinking.toggle` | ctrl+t | Toggle thinking blocks |
| `app.session.toggleNamedFilter` | ctrl+n | Toggle named session filter (accepted; pic has no view for it) |
| `app.editor.external` | ctrl+g | Open external editor |
| `app.message.copy` | ctrl+x | Copy selection or last assistant message |
| `app.message.followUp` | ctrl+q, alt+enter | Queue follow-up message |
| `app.message.dequeue` | alt+up | Restore queued messages |
| `app.clipboard.pasteImage` | ctrl+v | Paste files on macOS, images, or text from clipboard |
| `app.session.new` | none | Start a new session |
| `app.session.tree` | none | Open session tree |
| `app.session.fork` | none | Fork current session |
| `app.session.resume` | none | Resume a session |
| `app.tree.foldOrUp` | alt+left, ctrl+left | Fold tree branch or move up (accepted; pic has no view for it) |
| `app.tree.unfoldOrDown` | alt+right, ctrl+right | Unfold tree branch or move down (accepted; pic has no view for it) |
| `app.tree.editLabel` | shift+l | Edit tree label (accepted; pic has no view for it) |
| `app.tree.toggleLabelTimestamp` | shift+t | Toggle tree label timestamps (accepted; pic has no view for it) |
| `app.session.togglePath` | ctrl+p | Toggle session path display (accepted; pic has no view for it) |
| `app.session.toggleSort` | ctrl+s | Toggle session sort mode (accepted; pic has no view for it) |
| `app.session.rename` | ctrl+r | Rename session (accepted; pic has no view for it) |
| `app.session.delete` | ctrl+d | Delete session (accepted; pic has no view for it) |
| `app.session.deleteNoninvasive` | ctrl+backspace | Delete session when query is empty (accepted; pic has no view for it) |
| `app.models.save` | ctrl+s | Save model selection (accepted; pic has no view for it) |
| `app.models.enableAll` | ctrl+a | Enable all models (accepted; pic has no view for it) |
| `app.models.clearAll` | ctrl+x | Clear all models (accepted; pic has no view for it) |
| `app.models.toggleProvider` | ctrl+p | Toggle all models for provider (accepted; pic has no view for it) |
| `app.models.reorderUp` | alt+up | Move model up in order (accepted; pic has no view for it) |
| `app.models.reorderDown` | alt+down | Move model down in order (accepted; pic has no view for it) |
| `app.tree.filter.default` | ctrl+d | Tree filter: default view (accepted; pic has no view for it) |
| `app.tree.filter.noTools` | ctrl+t | Tree filter: hide tool results (accepted; pic has no view for it) |
| `app.tree.filter.userOnly` | ctrl+u | Tree filter: user messages only (accepted; pic has no view for it) |
| `app.tree.filter.labeledOnly` | ctrl+l | Tree filter: labeled entries only (accepted; pic has no view for it) |
| `app.tree.filter.all` | ctrl+a | Tree filter: show all entries (accepted; pic has no view for it) |
| `app.tree.filter.cycleForward` | ctrl+o | Tree filter: cycle forward (accepted; pic has no view for it) |
| `app.tree.filter.cycleBackward` | shift+ctrl+o | Tree filter: cycle backward (accepted; pic has no view for it) |
| `tui.editor.cursorUp` | up | Move cursor up |
| `tui.editor.cursorDown` | down | Move cursor down |
| `tui.editor.historyPrevious` | none | Select previous prompt history entry |
| `tui.editor.historyNext` | none | Select next prompt history entry |
| `tui.editor.cursorLeft` | left, ctrl+b | Move cursor left |
| `tui.editor.cursorRight` | right, ctrl+f | Move cursor right |
| `tui.editor.cursorWordLeft` | alt+left, ctrl+left, alt+b | Move cursor word left |
| `tui.editor.cursorWordRight` | alt+right, ctrl+right, alt+f | Move cursor word right |
| `tui.editor.cursorLineStart` | home, ctrl+a | Move to line start |
| `tui.editor.cursorLineEnd` | end, ctrl+e | Move to line end |
| `tui.editor.jumpForward` | ctrl+] | Jump forward to character |
| `tui.editor.jumpBackward` | ctrl+alt+] | Jump backward to character |
| `tui.editor.pageUp` | pageUp, ctrl+pageUp | Page up |
| `tui.editor.pageDown` | pageDown, ctrl+pageDown | Page down |
| `tui.editor.deleteCharBackward` | backspace | Delete character backward |
| `tui.editor.deleteCharForward` | delete, ctrl+d | Delete character forward |
| `tui.editor.deleteWordBackward` | ctrl+w, alt+backspace | Delete word backward |
| `tui.editor.deleteWordForward` | alt+d, alt+delete | Delete word forward |
| `tui.editor.deleteToLineStart` | ctrl+u | Delete to line start |
| `tui.editor.deleteToLineEnd` | ctrl+k | Delete to line end |
| `tui.editor.yank` | ctrl+y | Yank |
| `tui.editor.yankPop` | alt+y | Yank pop |
| `tui.editor.undo` | ctrl+- | Undo |
| `tui.input.newLine` | shift+enter, ctrl+j | Insert newline |
| `tui.input.submit` | enter | Submit input |
| `tui.input.tab` | tab | Tab / autocomplete |
| `tui.input.copy` | ctrl+c | Copy selection (accepted; pic has no view for it) |
| `tui.select.up` | up | Move selection up |
| `tui.select.down` | down | Move selection down |
| `tui.select.pageUp` | pageUp | Selection page up |
| `tui.select.pageDown` | pageDown | Selection page down |
| `tui.select.confirm` | enter | Confirm selection |
| `tui.select.cancel` | escape, ctrl+c | Cancel selection |
| `tui.altScreen.pageUp` | pageUp, shift+up | Scroll viewport up one page |
| `tui.altScreen.pageDown` | pageDown, shift+down | Scroll viewport down one page |
| `tui.altScreen.halfPageUp` | none | Scroll viewport up half a page |
| `tui.altScreen.halfPageDown` | none | Scroll viewport down half a page |
| `tui.altScreen.lineUp` | none | Scroll viewport up one line |
| `tui.altScreen.lineDown` | none | Scroll viewport down one line |
| `tui.altScreen.previousPrompt` | ctrl+shift+up, ctrl+up | Jump to previous semantic prompt (accepted; pic has no view for it) |
| `tui.altScreen.nextPrompt` | ctrl+shift+down, ctrl+down | Jump to next semantic prompt (accepted; pic has no view for it) |
| `tui.altScreen.search` | ctrl+shift+f, ctrl+f | Search the primary scroll view |
| `tui.altScreen.searchNext` | enter, ctrl+g | Select the next search match |
| `tui.altScreen.searchPrevious` | shift+enter, ctrl+shift+g | Select the previous search match |
| `tui.altScreen.searchClose` | escape | Close transcript search |
| `tui.altScreen.top` | ctrl+home, shift+pageUp, ctrl+shift+up | Scroll viewport to top |
| `tui.altScreen.bottom` | ctrl+end, shift+pageDown, ctrl+shift+down | Scroll viewport to bottom |
<!-- keys:end -->