Repository navigation
Closed
Labels
TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displayenhancementNew feature or request
Description
What feature would you like to see?
I would like to request an interactive history search feature for the Codex CLI, similar to the Ctrl+R functionality in bash/zsh shells. This would allow users to quickly search and reuse previous prompts.
Feature Description
Implement an interactive reverse search through prompt history:
- Trigger: Press
Ctrl+Rto enter history search mode - Search: Type to search through previous prompts (fuzzy matching)
- Navigate: Use
Ctrl+Rrepeatedly to cycle through matches,Ctrl+Sfor forward search - Select: Press Enter to use the selected prompt, Escape to cancel
- Edit: Arrow keys to exit search mode and edit the selected prompt before submitting
User Experience
-
Entering search mode:
> [Ctrl+R pressed] (reverse-i-search)`': _ -
Searching:
(reverse-i-search)`refactor': refactor this function to use async/await -
Multiple matches: Press
Ctrl+Ragain to cycle through older matches
Implementation Details
- Store prompt history persistently (local file or database)
- Implement fuzzy/substring matching algorithm
- Display match with highlighting of matched substring
- Support for:
- Case-insensitive search
- Multi-word search terms
- Configurable history size limit
- Optional: frecency-based sorting (frequency + recency)
Are you interested in implementing this feature?
No, but I'm happy to test and provide feedback.
Additional information
No response
Reacted by Yasin Hossain , Bhargav Narayanan, 007pig, Cullen Rhodes, Khang Ly, Zhonghao Guo, Sam Gu, Ravi, railsoid, Keith Hughitt and 22 more
Metadata
Metadata
Assignees
Labels
TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displayenhancementNew feature or request
Activity
PanJason commentedon Mar 31, 2026
Hi I have implemented here #16249. Feel free to use it. I will keep rebasing until codex allows a pr over it