Skip to content

Feature: Up/Down arrow prompt-history recall in the input boxes (CLI + Desktop) #1125

Description

@mainstringargs

Summary

Pressing / in the main prompt input should cycle through previously submitted prompts — the way every shell does. History should persist across sessions.

Motivation

  • Iteration is the core loop. Most real usage is "send a prompt, tweak it, send again." Today a typo or a small wording change means retyping (or scrolling back through the transcript to find and manually copy) the earlier prompt.
  • Muscle memory. Every terminal user reflexively hits to fix the last command. Its absence is noticed immediately and daily.
  • Resend after failure. When a run dies mid-flight (network drop, session expiry — cf. Session state is lost after free session expires or run is interrupted #1054), the fastest recovery is , Enter.
  • Table stakes. Comparable agentic CLIs support this; its absence is one of the first things new users report hitting.

Searched the tracker (open + closed) for "arrow", "history", "command/prompt/input history": no existing request. Closest neighbors are #847 (Ctrl+←/→ word-jump — same "make the editor behave like a readline input" family) and #749 (a bug report about session-list history freezing the terminal, different feature).

Proposed behavior

  1. In the free-text composer, recalls the previously submitted prompt; moves forward again.
  2. Pressing past the newest entry restores the in-progress draft exactly as it was left (see edge case 1).
  3. History is persisted to disk per install and survives restarts, scoped per project directory (with a documented fallback/global option).
  4. Consecutive duplicates are collapsed (don't push the same prompt twice in a row).
  5. Recalled entries are editable before resubmitting — recall just fills the buffer, it does not auto-submit.

Edge cases to nail down

  1. Draft preservation — cycling to the bottom must restore the unsent text the user was typing, byte-for-byte. Losing a half-written draft is worse than having no feature.
  2. Precedence with popups/menus — when an autocomplete, slash-command palette, or selection menu is open, / must keep navigating that UI; history recall applies only when the bare composer has focus (Esc-close-then- path should work).
  3. Multi-line prompts — a multi-line submission is recalled as one unit, newlines intact.
  4. Windows terminals — arrow keys arrive as escape sequences that differ between Windows Terminal, conhost, and mintty/Git Bash, and ConPTY cursor-key modes matter (cf. the area:windows label). Needs coverage on all three.
  5. Secrets in history — prompts occasionally contain pasted tokens/env values. Provide an explicit off-switch (e.g., FREEBUFF_HISTORY_SIZE=0 disables persistence) and document that history is plaintext on disk.
  6. Size cap — cap stored entries (~200–500) and trim oldest; don't let a year of giant prompts bloat the profile.
  7. Errored submissions — record them too (that's precisely when you want instant resend), unless there's a reason not to.
  8. Slash commands — include them in history (they're typed inputs users repeat, e.g. /model, /resume).
  9. Empty state — no-op (no bell/error spam) when history is empty.

Alternatives considered

  • Ctrl+R fuzzy search only — great power-user complement, wrong primary UX; nobody discovers it, and it doesn't satisfy the one-keystroke fix-the-last-prompt loop. Suggest as a follow-up, not a substitute.
  • Session-only (non-persistent) history — partial win; most of the pain is across restarts.
  • A /history list command — useful for browsing old prompts, but higher-friction than arrow recall.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliThe Codebuff/Freebuff terminal clientbot:triagedClassified by the community triage bottype:featureA request for new behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions