Keyboard shortcuts available in the default interactive REPL. Covers submission (Enter, Ctrl+Enter, Shift+Enter), history (Up/Down, Ctrl+R), completion (Tab), compute-node picker (Ctrl+N), screen clear (Ctrl+L), interrupt and exit (Ctrl+C, Ctrl+D), re-run (F5), cancel (F8), and diagnostic navigation (F3).
## Overview The default REPL binds a fixed set of keyboard shortcuts for editing, submission, history navigation, completion, and session control. Every shortcut works inside the interactive shell; a subset (Ctrl+C, Ctrl+D) also applies when the shell is waiting at an inline prompt outside the editor. The full reference is given as a single table rather than one page per key. The REPL's `/help` command renders the same information live. ## Shortcut reference | Key | Action | | --- | --- | | Enter | Submit if the buffer looks complete (trailing `;` or balanced quotes and parentheses); otherwise insert a newline. | | Shift+Enter | Insert a newline unconditionally. | | Ctrl+Enter | Force-submit the buffer even if the looks-complete heuristic says otherwise. Also runs the highlighted entry when the slash menu is open. | | Tab | In the slash menu: complete to the highlighted slash command. In SQL mode: commit the top-ranked candidate from the identifier plus keyword completion popup. | | Ctrl+C | Interrupt the current input (clears the buffer). Press twice within ~1 second to exit. During an in-flight query, sends a cancel. | | Ctrl+D | Exit the CLI. Flushes the scrollback to `~/.deltaforge/sessions/<timestamp>.jsonl`. | | Ctrl+L | Clear scrollback. Equivalent to `/clear`. | | Ctrl+N | Quick compute-node switcher: pre-fills the input with `/nodes` so the next Enter renders the node picker. | | Ctrl+R | Reverse history search through `~/.deltaforge/history` (1000 entries, incremental, case-insensitive). | | Up / Down | Outside completion popups: navigate command history. Inside the slash menu or completion popup: move the highlight. | | Esc | Dismiss the slash menu or completion popup and clear the buffer. | | F3 / Shift+F3 | Step through diagnostic markers in the scrollback (next and previous error). | | F5 | Re-run the last submitted SQL statement. | | F8 | Cancel the in-flight query (same effect as Ctrl+C during execution). | ## Behavior - Enter's submit-or-newline decision is driven by the `looks_complete` heuristic: trailing semicolon, balanced parentheses, matched single quotes, and no unclosed `--` or block comment. See `CLI_SHELL_STATEMENT_COMPLETE`. - Ctrl+C requires a second press within roughly one second to exit. A single press clears the current input and stays in the REPL. - Ctrl+D exits immediately (no double-press confirmation). The scrollback is flushed first. - Ctrl+L and `/clear` do the same thing; the keybinding is a convenience for muscle-memory from other shells. - F5 re-runs the most recent submission from the current session, not from the persisted history file. - Up and Down overload between history navigation and popup highlight movement depending on context. When the cursor sits at the top row of a multi-line buffer, Up steps into history; when it sits elsewhere, Up moves the cursor. ## Compatibility - The bindings apply to the default interactive shell. Under `--classic` (legacy reedline REPL), a simpler reedline keymap applies: Ctrl+R, Up, Down, Tab, and Enter work, but multi-line submission, F-keys, and the slash menu are unavailable. - In non-interactive modes (piped stdin, `query`, `run`, `demo-test`) no keybindings apply; those modes are driven by exit status and streamed output.
# Submit a multi-line statement by ending with a semicolon and pressing Enter
SELECT count(*)
FROM sales.orders
WHERE status = 'shipped';
# Force-submit a buffer the heuristic thinks is incomplete
# Press Ctrl+Enter after typing:
SELECT 1 -- no trailing semicolon
# Reverse-search history
# Ctrl+R, then start typing; first match highlights, Enter accepts.
# Switch compute nodes interactively
# Ctrl+N -> picker opens -> j/k or Up/Down -> Enter to pin
# Cancel an in-flight query without exiting the REPL
# F8 (or Ctrl+C during execution)