Skip to content

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

Closed as not planned

Description

@Jasperabez

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.

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Dec 4, 2025
  2. github-actions commented on Dec 4, 2025

    @github-actions
    Contributor

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

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

  3. isomoes commented on Dec 18, 2025

    @isomoes

    +1 need it

  4. rekram1-node commented on Dec 18, 2025

    @rekram1-node
    Collaborator

    This is a good idea

  5. rekram1-node commented on Dec 18, 2025

    @rekram1-node
    Collaborator

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

  6. isomoes commented on Dec 19, 2025

    @isomoes

    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.

  7. ShpetimA commented on Dec 19, 2025

    @ShpetimA
    Contributor

    @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

  8. isomoes commented on Dec 20, 2025

    @isomoes

    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.

    Image
  9. isomoes commented on Dec 24, 2025

    @isomoes

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

    Image
  10. isomoes commented on Jan 8, 2026

    @isomoes

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

  11. ayushhh1010 commented on Jan 15, 2026

    @ayushhh1010

    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!

  12. 1 remaining item

  13. added a commit that references this issue on Feb 5, 2026
    5c9c635
  14. added a commit that references this issue on Mar 14, 2026
    98402d1
  15. maxpill commented on Mar 17, 2026

    @maxpill

    Can I pick this issue up, or is it currently actively worked on by someone else?

  16. added a commit that references this issue on Mar 17, 2026
    2e9dc43
  17. nferreira commented on Apr 2, 2026

    @nferreira

    I have implemented the feature but I have a couple of questions.

    1. Notice that ctrl+r is already used by rename session.

    packages/opencode/src/config/config.ts

      export const Keybinds = z
        .object({
          leader: z.string().optional().default("ctrl+x").describe("Leader key for keybind combinations"),
          .
          .
          .
          session_rename: z.string().optional().default("ctrl+r").describe("Rename session"),
          .
          messages_redo: z.string().optional().default("<leader>r").describe("Redo message"),
          .
          .
          .
        })
        .strict()
        .meta({
          ref: "KeybindsConfig",
        })
    
    

    Should we change the session_name keybind? In my implementation I changed it to none as <leader>r is already in use by messages_redo.

    1. I have implemented it with an overlay, but I wonder if y'all would prefer a Dialog.

    Demo:

    Image

  18. gurvirsinghdev commented on Apr 13, 2026

    @gurvirsinghdev

    I think the issue is still open. I can pick this up. Please update me, so that I can begin working on this.

  19. xthreehao commented on Apr 18, 2026

    @xthreehao

    I think the issue is still open.
    I‘d like to take this issue.
    Could you please assign it to me?

  20. removed
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on May 3, 2026
  21. kommander commented on May 3, 2026

    @kommander
    Contributor

    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.

  22. jia-kai commented on Jun 27, 2026

    @jia-kai

    I made a plugin so I can search history while waiting for the official impl :)

    https://github.com/jia-kai/opencode-productivity

    Image
  23. github-actions commented on Aug 27, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions