You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Ctrl+R to search and navigate prompt history instead of just arrow keys #5062
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Implement something similar to reverse-i-search on bash.
Benefits:
instead of using arrow keys to find a previous prompt executed and resend that prompt, do a reverse search and load it into the prompt box. Saves time.
Reacted by isomoes, Niels Mentink, justfortheloveof, Udo, Mahdi, Alex Hoyau, Kelvin Rosado, sandip, Sebastian Rojo, Michael Liquori and 25 more
@jiahaoxiang2000 I checked the pr you created out of curiosity and found an issue with the onSelect logic you should should offset the cursor logic otherwise the ui will only show one line if you have a multline input input.cursorOffset = input.plainText.length
It's not my place to say but with just showing truncated text i don't see how this will be very useful since its very confusing without seeing the full text content as to what was written in a previous prompt.
With the UI you went with I ran opus 4.5 to get some dummy ui for a version with full context and suggested a ui similar to fzf --preview but @rekram1-node could give better feedback here as to what they would want. Maybe just simple search style like bash where you search and it shows on the input instantly instead of opening history modal.
I checked the pr you created out of curiosity and found an issue with the onSelect logic you should should offset the cursor logic otherwise the ui will only show one line if you have a multline input input.cursorOffset = input.plainText.length
we had fix this, 38b567a in #5775 , very thank @ShpetimA . we also add the matched context function.
Hi! I'd like to work on this feature if it's still available.
My approach
I'll implement a bash-style reverse search:
1)Press Ctrl+R to open search overlay
2)Type to filter history in real-time
3)Ctrl+R cycles through matches, Enter selects, Esc cancels
4)Create a ReverseSearchOverlay component with match counter and preview
Also, Any preferred UI pattern for overlays in this project?
Should search be case-insensitive?
Where is prompt history stored currently?
I have React/TypeScript experience and will include demo screenshots in the PR. Let me know if this sounds good!
I would love to bring this to OpenCode, however I would prefer a generic "search & highlight" feature or addon for opentui on a lower level. There is no plan currently, but open to discuss ideas on how to get it done.
Activity
github-actions commentedon Dec 4, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
isomoes commentedon Dec 18, 2025
+1 need it
rekram1-node commentedon Dec 18, 2025
This is a good idea
rekram1-node commentedon Dec 18, 2025
If anyone wants to make a pr i think this would be a good addition
isomoes commentedon Dec 19, 2025
@rekram1-node we create PR #5775 , thanks to review it.
ShpetimA commentedon Dec 19, 2025
@jiahaoxiang2000 I checked the pr you created out of curiosity and found an issue with the onSelect logic you should should offset the cursor logic otherwise the ui will only show one line if you have a multline input
input.cursorOffset = input.plainText.lengthIt's not my place to say but with just showing truncated text i don't see how this will be very useful since its very confusing without seeing the full text content as to what was written in a previous prompt.

With the UI you went with I ran opus 4.5 to get some dummy ui for a version with full context and suggested a ui similar to fzf --preview but @rekram1-node could give better feedback here as to what they would want. Maybe just simple search style like bash where you search and it shows on the input instantly instead of opening history modal.

isomoes commentedon Dec 20, 2025
we had fix this, 38b567a in #5775 , very thank @ShpetimA . we also add the matched context function.
isomoes commentedon Dec 24, 2025
@ShpetimA Claude code v2.0.70 used the full context and suggested you talked
isomoes commentedon Jan 8, 2026
@rekram1-node can review the #5775 & #6276, really need this search history function. thanks
ayushhh1010 commentedon Jan 15, 2026
Hi! I'd like to work on this feature if it's still available.
My approach
I'll implement a bash-style reverse search:
1)Press Ctrl+R to open search overlay
2)Type to filter history in real-time
3)Ctrl+R cycles through matches, Enter selects, Esc cancels
4)Create a ReverseSearchOverlay component with match counter and preview
Also, Any preferred UI pattern for overlays in this project?
Should search be case-insensitive?
Where is prompt history stored currently?
I have React/TypeScript experience and will include demo screenshots in the PR. Let me know if this sounds good!
1 remaining item
feat(tui): add Ctrl+R prompt history search
feat(tui): add Ctrl+R reverse search for prompt history
maxpill commentedon Mar 17, 2026
Can I pick this issue up, or is it currently actively worked on by someone else?
feat: add Ctrl+R reverse history search for prompt input
nferreira commentedon Apr 2, 2026
I have implemented the feature but I have a couple of questions.
packages/opencode/src/config/config.tsShould we change the
session_namekeybind? In my implementation I changed it tononeas<leader>ris already in use bymessages_redo.Demo:
gurvirsinghdev commentedon Apr 13, 2026
I think the issue is still open. I can pick this up. Please update me, so that I can begin working on this.
xthreehao commentedon Apr 18, 2026
I think the issue is still open.
I‘d like to take this issue.
Could you please assign it to me?
kommander commentedon May 3, 2026
I would love to bring this to OpenCode, however I would prefer a generic "search & highlight" feature or addon for opentui on a lower level. There is no plan currently, but open to discuss ideas on how to get it done.
jia-kai commentedon Jun 27, 2026
I made a plugin so I can search history while waiting for the official impl :)
https://github.com/jia-kai/opencode-productivity
github-actions commentedon Aug 27, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.