[FEATURE]: Ctrl+R to search and navigate prompt history instead of just arrow keys #3298

Open
opened 2026-02-16 17:39:34 -05:00 by yindo · 10 comments
Owner

Originally created by @Jasperabez on GitHub (Dec 4, 2025).

Feature hasn't been suggested before.

  • 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.
Image

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.
Originally created by @Jasperabez on GitHub (Dec 4, 2025). ### Feature hasn't been suggested before. - [x] 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. <img width="268" height="30" alt="Image" src="https://github.com/user-attachments/assets/f413dcc3-2554-4207-8142-e0d07cce2365" /> **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.
yindo added the help-wanteddiscussiongood first issue labels 2026-02-16 17:39:34 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 4, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #1701: Feature request: history reverse search like curses-based TUIs

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Dec 4, 2025): This issue might be a duplicate of existing issues. Please check: - #1701: Feature request: history reverse search like curses-based TUIs Feel free to ignore if none of these address your specific case.
Author
Owner

@isomoes commented on GitHub (Dec 17, 2025):

+1 need it

@isomoes commented on GitHub (Dec 17, 2025): +1 need it
Author
Owner

@rekram1-node commented on GitHub (Dec 18, 2025):

This is a good idea

@rekram1-node commented on GitHub (Dec 18, 2025): This is a good idea
Author
Owner

@rekram1-node commented on GitHub (Dec 18, 2025):

If anyone wants to make a pr i think this would be a good addition

@rekram1-node commented on GitHub (Dec 18, 2025): If anyone wants to make a pr i think this would be a good addition
Author
Owner

@isomoes commented on GitHub (Dec 18, 2025):

If anyone wants to make a pr i think this would be a good addition

@rekram1-node we create PR #5775 , thanks to review it.

@isomoes commented on GitHub (Dec 18, 2025): > If anyone wants to make a pr i think this would be a good addition @rekram1-node we create PR #5775 , thanks to review it.
Author
Owner

@ShpetimA commented on GitHub (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.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.
Image

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.
Image

@ShpetimA commented on GitHub (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.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. <img width="666" height="429" alt="Image" src="https://github.com/user-attachments/assets/fb632b74-6830-4aa8-9ecc-1caa8c32ee0e" /> 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. ![Image](https://github.com/user-attachments/assets/78476d7d-a8e3-488e-9189-3a4075695564)
Author
Owner

@isomoes commented on GitHub (Dec 19, 2025):

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, https://github.com/sst/opencode/pull/5775/commits/38b567a2f1bab4e3549da861e32b6e6f2e8fab41 in #5775 , very thank @ShpetimA . we also add the matched context function.

Image
@isomoes commented on GitHub (Dec 19, 2025): > 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, https://github.com/sst/opencode/pull/5775/commits/38b567a2f1bab4e3549da861e32b6e6f2e8fab41 in #5775 , very thank @ShpetimA . we also add the matched context function. <img width="2005" height="1227" alt="Image" src="https://github.com/user-attachments/assets/3567d5ab-d388-4137-b20d-3a10bf1fdaa5" />
Author
Owner

@isomoes commented on GitHub (Dec 23, 2025):

@ShpetimA Claude code v2.0.70 used the full context and suggested you talked

Image
@isomoes commented on GitHub (Dec 23, 2025): @ShpetimA Claude code v2.0.70 used the full context and suggested you talked <img width="822" height="376" alt="Image" src="https://github.com/user-attachments/assets/8dc5db28-f23a-4329-91ea-e8dc34ccf274" />
Author
Owner

@isomoes commented on GitHub (Jan 8, 2026):

@rekram1-node can review the #5775 & #6276, really need this search history function. thanks

@isomoes commented on GitHub (Jan 8, 2026): @rekram1-node can review the #5775 & #6276, really need this search history function. thanks
Author
Owner

@ayushhh1010 commented on GitHub (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!

@ayushhh1010 commented on GitHub (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!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3298