#16636

Spec: per-directory command history (GH5336)

Openedgardmellowants to merge intofrom

Description

Adds the product and tech spec for per-directory command history (issue #5336, labeled ready-to-spec): an opt-in mode where up/down arrow command history is scoped to the current working directory, with a Ctrl+G toggle back to global history, mirroring the zsh per-directory-history plugin referenced in the issue.

Key points of the proposal:

  • One shared implementation in the existing up-arrow combiner (History::up_arrow_suggestions_for_terminal_surface), so the GUI inline history menu, GUI history search, and TUI history menu all behave identically.
  • New directory_scoped_history setting (default off), persisted and cloud-synced like other input settings.
  • HistoryEntry already records pwd for Warp-executed commands, so no storage/schema changes are needed; v1 matches pwd strings exactly.
  • Ctrl+G toggle follows the InsertLastWordPrevCommand action/binding precedent.

Discussion on the design is welcome here — this PR is the home for product/technical review per the contributing guide. Once the specs are approved, implementation continues on this same PR.

Linked Issue

  • The linked issue is labeled ready-to-spec or ready-to-implement → #5336 (ready-to-spec).
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes). → N/A for this docs-only spec PR; screenshots will accompany the implementation commits.

Testing

N/A — this PR contains only specification documents (specs/GH5336/product.md, specs/GH5336/tech.md); there are no runtime code changes. The planned unit tests and manual validation steps (each mapped to a numbered product invariant) are specified in specs/GH5336/tech.md ("Testing and validation") and will be executed as part of the implementation on this PR after spec approval.

  • I have manually tested my changes locally with ./script/run → N/A (docs-only)

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Co-Authored-By: Warp agent@warp.dev

Activity

2
cla-bot[bot]7d ago

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @edgardmello on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.