History file

`--classic` persists submissions to `~/.deltaforge/history` via reedline (1000-entry file-backed ring). The interactive shell maintains an in-memory history that does not write to this file.

Category: repl-features

Description

## Overview There are two distinct history mechanisms in the CLI, one per shell surface. The `--classic` REPL uses `reedline::FileBackedHistory` anchored to `~/.deltaforge/history` with a 1000-entry cap. The interactive shell uses an in-memory `History` struct (`shell/app.rs`) that is created fresh per session, populated as turns are submitted, and discarded at exit; the scrollback JSONL is the interactive shell's persistent record, not the history file. ## Behavior (classic REPL) - File: `~/.deltaforge/history` (derived from `config::history_file()`). - Capacity: 1000 most recent entries. Older lines are evicted as the file fills. - Recall: Up and Down walk through history at the top / bottom cursor row of the reedline buffer, respectively. - Reverse search: Ctrl+R opens reedline's incremental search, which matches against the file-backed entries. - Tab: bound to the SQL keyword completion menu, not to history recall. ## Behavior (interactive shell) - In-memory only. A successful submission appends the effective command string to `state.history.entries` (duplicate consecutive entries are collapsed). - Up/Down at the first/last row of the multi-line editor walks `state.history`. The first Up stashes the in-progress buffer into `state.history.pending` so walking forward past the newest entry restores what you were typing. - the shell's status indicators show `history N/M` while the pointer is active; typing any character resets the pointer to None. - No reverse search. No persistence to disk. ## Interaction - The two histories do not share storage. Commands typed in the interactive shell never land in `~/.deltaforge/history`, and commands from the classic REPL are not visible to a later interactive session. - The session JSONL files under `~/.deltaforge/sessions/` are the interactive shell's persistence mechanism and are consumed by `--resume`, not by history-recall keybindings. ## Compatibility - Reedline's history file format is a plain newline-delimited text file. Hand-editing while `--classic` is not running is safe; reedline reloads on next start.

Examples

# Inspect the classic-REPL history file
cat ~/.deltaforge/history | tail -20

Pitfalls

See Also

Open in interactive docs →   DeltaForge home →