Repository navigation
Closed
Copy link
Labels
Description
Summary
Make the chat input feel like a native shell: Ctrl+R opens an fzf-style fuzzy search over prompt history, instead of toggling raw markdown. The raw/rendered markdown toggle (display_toggle_raw_format) moves to Ctrl+M (M for markdown).
Today Up/Down (text_editing_history_up / text_editing_history_down) step through history one entry at a time and Tab cycles an inline suggestion, but there is no way to search history.
Proposed behavior
- Ctrl+R in the chat view opens a history search overlay above the input: a query line plus a list of matching prompts, newest first, duplicates shown once (most recent occurrence).
- Typing filters the list with fuzzy matching, and the matched characters are highlighted in each row (bold/underline in the active theme).
- Up/Down move the selection. Enter loads the selected prompt into the input for editing (it is not sent). Esc closes the overlay and leaves the input as it was (and does not count toward the double-Esc "go back in time" binding).
- Multi-line prompts show on one line in the list and are restored with their original newlines.
Implementation notes
- History source:
history.Store(internal/presentation/tui/history/store.go) already loads the per-project prompt history (~/.infer/projects/<slug>/history/history) intoallHistory; it only needs a read accessor. This is infer's own prompt history, not the user's bash/zsh history. - Fuzzy matching and highlighting already exist, no new picker dependency needed:
github.com/sahilm/fuzzyis used inautocomplete/autocomplete.go(fuzzy.Find+MatchedIndexes) andcomponents/file_explorer.go, andhighlightMatchesinautocomplete.goalready bolds/underlines matched characters. Reuse those and style the overlay with lipgloss like the other overlays. - Keybinding: add a configurable action, e.g.
text_editing_history_search(defaultctrl+r), inconfig/keybindings.goandinternal/presentation/tui/keybinding/actions.gowith achatView(...)context, so the hardcoded Ctrl+R refresh in the/diffviewer (diff_viewer.go:506) and file explorer (file_explorer.go:320) keeps working. - Ctrl+M caveat: in terminals without keyboard enhancements (kitty keyboard protocol), Ctrl+M sends the same byte as Enter (CR), so bubbletea reports it as
enterand pressing Ctrl+M sends the message instead of toggling markdown. Terminals with the protocol (Kitty, Ghostty, WezTerm, foot, iTerm2 with CSI u, tmux withextended-keys) reportctrl+mdistinctly. Proposal: default keysctrl+mplus a fallback that works everywhere, e.g.alt+m. components/input_view.go:146mapsctrl+mto the textareaInsertNewline; it must be removed from there, or Ctrl+M will also insert a newline.- This changes a default binding users have muscle memory for; call it out in the release notes. Users who already overrode
display_toggle_raw_formatinkeybindings.yamlkeep their keys.
Acceptance Criteria
- Ctrl+R in the chat view opens a fuzzy search overlay over the current project's prompt history, newest first, duplicates collapsed.
- Typing filters the list with fuzzy matching and the matched characters are highlighted in each row.
- Up/Down move the selection; Enter loads the selected prompt into the input without sending it; Esc closes the overlay and leaves the input unchanged.
- Multi-line prompts display on one line in the list and are restored with their original newlines.
- History search is a configurable action (default
ctrl+r) that appears ininfer keybindings listand the help view and passesinfer keybindings validate. -
display_toggle_raw_formatdefaults toctrl+mplus a fallback that works without keyboard enhancements (e.g.alt+m), andctrl+mis removed from the textareaInsertNewlinekeymap. - Ctrl+R still refreshes in the
/diffviewer and file explorer. -
docs/configuration-reference.mddocuments the new action and the changed default; unit tests cover filtering, selection, and Esc restoring the input.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
[-][FEATURE] Ctrl+R changing instead of show raw action to fzf (common linux users practice)[/-][+][FEATURE] Ctrl+R opens fuzzy history search, raw markdown toggle moves to Ctrl+M[/+]edenreich commentedon Sep 29, 2026
@infer Can you implement this?
inference-gateway-maintainer commentedon Sep 29, 2026
Model:
ollama_cloud/glm-5.3-flash· View JobTodos
Pull Request
#1417
✅ Infer Result: Success
Implementation complete. All work is committed, pushed, verified, and PR #1417 is ready for review.
Summary
I implemented issue #1412 on branch
fix/issue-1412, resolved by PR inference-gateway/cli#1417 (commit110a3e9, marked ready for review).What changed:
components/history_search_view.gooverlay renders above the chat input with a query line plus matching prompts: newest first, duplicates collapsed to their most recent occurrence, fuzzy filtered via the existingsahilm/fuzzy+HighlightMatcheshelpers (bold/underline on matched characters, reusingautocomplete.HighlightMatches), wrap-around Up/Down selection, a no-match empty state, and multi-line prompts flattened to one row with a return glyph while Enter restores the original newlines. Enter loads the prompt into the input without sending it, and Esc closes the overlay leaving the draft untouched - its Esc is consumed before the keybinding dispatcher, so it never counts toward the double-Esc go-back-in-time binding.text_editing_history_searchaction (defaultctrl+r, chat view, no-pending-approval gate) wired throughconfig/keybindings.go, the registry, and aHistorySearchOpenEvent; history data comes from a newhistory.Store.GetAllHistory()read accessor.display_toggle_raw_formatdefaults toctrl+mplusalt+m(a fallback that works without the Kitty keyboard protocol, where Ctrl+M is indistinguishable from Enter), andctrl+mwas removed from the textareaInsertNewlinekeymap. The/diffviewer and file explorer keep their hardcoded Ctrl+R refresh untouched.docs/configuration-reference.mddocuments the new action, the changed default, and the terminal caveat; follow-up docs ticket filed at inference-gateway/docs#868.Checks:
task fmt,task vet,task lint(0 issues), and the fulltask testsuite all pass locally; the pre-commit gate (mod tidy, mocks, fmt, lint) passed on commit. The board item for this issue was set to In progress at the start and QA after the PR opened.Model:
ollama_cloud/glm-5.3-flash· Exit Code:0· Duration: 19m 38sTokens: 19,512,114 in · 90,148 out · 19,602,262 total (88 requests)
Tool calls: 121 total · 100% success rate
Traces
Stats
Triggered by edenreich · Infer Action · OSS
inference-gateway-releaser commentedon Sep 30, 2026
🎉 This issue has been resolved in version 0.219.0 🎉
The release is available on:
Your semantic-release bot 📦🚀