Skip to content

Prefix-filtered history recall (Up/Down) and Ctrl-R reverse search #45

Description

@Mineru98

Problem

  • Up/Down history recall walks the entire history regardless of what is already typed, so you cannot narrow recall by typing a prefix first.
  • There is no way to search history by content (no reverse incremental search).

Proposal

  1. Prefix-filtered recall — when the prompt is non-empty, Up/Down visit only history entries starting with the typed text (fish/zsh history-search-backward). An empty prompt keeps today's full-history walk, so existing behaviour is preserved.
  2. Ctrl-R reverse incremental search — type to narrow to the most recent substring match, Ctrl-R again for older matches, Enter to accept the match into the prompt, Esc to cancel.

Scope

  • Ourocode.Terminal.HistoryNavigation: prefix-aware move/2.
  • new Ourocode.Terminal.HistorySearch: pure reverse substring search.
  • Ourocode.Terminal.KeyReader: decode Ctrl-R.
  • Ourocode.Terminal.TuiState (+ initial state): search-mode state and transitions.
  • Ourocode.Terminal.TuiNormalEvent + new Ourocode.Terminal.TuiSearchEvent: key routing.
  • Ourocode.Terminal.RendererChrome: (reverse-i-search)… composer line.

Acceptance criteria

  • Typing a prefix then Up cycles only matching entries; an empty prompt still walks the whole history.
  • Returning newer past the newest match restores the typed draft.
  • Ctrl-R opens search; typing filters to the latest substring match; repeated Ctrl-R walks to older matches.
  • Enter accepts the match into the prompt; Esc restores the pre-search buffer.
  • Editing exits browse/search cleanly; disk-persisted history is unaffected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions