GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [FEATURE]: TUI - Search for and find string in session buffer · Issue #4714 · anomalyco/opencode

[FEATURE]: TUI - Search for and find string in session buffer #4714

New issue
Copy link
New issue
Copy link
Done
#64870
Done
[FEATURE]: TUI - Search for and find string in session buffer#4714
#64870
Copy link
Assignees
simonklee

Description

@cwegener
cwegener
opened on Nov 24, 2025
Issue body actions

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

Similar to how 'find' works in a text editor, I sometimes need to find a certain string in the agent's output.

This does not seem possible in the TUI at the moment.

Some possible inspirations to look at for designing such a feature:

  1. vim (both normal buffers and vim's terminal buffer)
  2. tmux

Also, ghostty community has had some interesting conversations about their design of the scrollback search feature: ghostty-org/ghostty#189

Reacted by Tom, Arsham Shirvani, Shmuel Hizmi, Niels Mentink, Sashank Gunda, Steven Lu, Johann Pardanaud, Anatoli Tsinovoy, nenahp, Justas Raudonius and 61 more
Reacted by xpufx, OPProductivity, Ioan-Victor Stan, Melker Ulander, cateyes99, cep207 and Levon Tumanyan
Reacted by Ioan-Victor Stan, Melker Ulander, Theodor Nikulin, Levon Tumanyan and Fabien Battello
Reacted by Melker Ulander and Levon Tumanyan

Activity

Next
  1. cwegener
    added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Nov 24, 2025
  2. github-actions commented on Nov 24, 2025

    @github-actions
    github-actionsBot
    on Nov 24, 2025 – with GitHub Actions
    Contributor
    More actions

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

    • 🚀 Feature Request: Add Quick Session Search Interface (Ctrl+K) #3361: Add Quick Session Search Interface (Ctrl+K) - Requests a search interface for sessions with real-time filtering, which is similar in concept to finding strings in output
    • feat: Copy Mode for OpenCode #2755: Copy Mode for OpenCode - Requests vim/tmux-like copy mode with text selection and navigation, which would support finding and selecting specific text in the buffer

    Feel free to ignore if your specific use case for searching agent output differs from these session/copy mode features.

  3. rekram1-node commented on Nov 24, 2025

    @rekram1-node
    rekram1-node
    on Nov 24, 2025
    Member
    More actions

    good idea

    Reacted by cwegener, Kwami Agbodji, notAunty, OPProductivity and Vlad Startsev
  4. cwegener commented on Nov 24, 2025

    @cwegener
    cwegener
    on Nov 24, 2025
    Author
    More actions

    good idea

    I only just noticed it today for the first time that this is a functionality that would be useful. (And I've been using opencode for 2 months now)

    The way I realized that I needed to find strings in the session's output buffer was because I was running opencode on a codebase that I am not extremely familiar with. And I was running the 'Plan' agent quite a lot to produce a lot of summaries to specific questions that I had about the code base (mostly architecture).

    And when I went back to the historical session in the TUI on the next day, I wanted to check if some of the session output had already mentioned one particular method inside one of the codebase's modules I wanted to know more about.

    My idea being, that if my previous session's context was already mentioning the name of the particular method I was after, I might just continue that same session and get a really good output in response. And otherwise I might start a new session ...

    But I'm sure there are additional use cases for such find/search inside session buffer functionality.

  5. ariane-emory commented on Nov 26, 2025

    @ariane-emory
    ariane-emory
    on Nov 26, 2025
    Contributor
    More actions

    Upvoting, I'd love to see this feature too.

  6. OpeOginni commented on Nov 29, 2025

    @OpeOginni
    OpeOginni
    on Nov 29, 2025
    Contributor
    More actions

    Have a PR for something like this, any feedback?

    further-reduced.mov
    Reacted by Niels Mentink, Sashank Gunda, Johann Pardanaud, Anatoli Tsinovoy, Toni, Sahaj Bhatt, Adam Spiers, Theodor Nikulin and Oskar Jagodziński
    Reacted by Kwami Agbodji and notAunty
  7. rekram1-node commented on Nov 29, 2025

    @rekram1-node
    rekram1-node
    on Nov 29, 2025
    Member
    More actions

    this is cool, Im not 100% sure if we wanna put it in the prompt box but this is very nice ill have david (our designer) take a look

    Reacted by OpeOginni and Johann Pardanaud
  8. xidiot commented on Jan 19, 2026

    @xidiot
    xidiot
    on Jan 19, 2026
    More actions

    This is something I'm looking since day 1.

    Reacted by Anton Petrov and Denner
  9. unphased commented on Jan 19, 2026

    @unphased
    unphased
    on Jan 19, 2026
    More actions

    I'm building a high scalability terminal recorder that will let me travel through time to solve this issue in general for terminals, but... it's not close to ready yet and it's also not quite the right hammer for this nail.

    I must say it's rather appalling that this feature does not exist yet. I've been extremely impressed with opencode so far though. For example the syntax colorization of code diffs is chef's kiss:

    Image
    Reacted by Adam Spiers and Denner
  10. nesk commented on Jan 20, 2026

    @nesk
    nesk
    on Jan 20, 2026
    More actions

    This would definitely be useful, I sometimes have to search for a specific a message in the session.

  11. DebelToni commented on Jan 30, 2026

    @DebelToni
    DebelToni
    on Jan 30, 2026
    More actions

    Get this merged to main ASAP. Any implementation is fine. BTW why does the TTI use the single windowed mode instead of continuing terminal flow so we can use tmux to find and to stuff?

  12. unphased commented on Jan 31, 2026

    @unphased
    unphased
    on Jan 31, 2026
    More actions

    Because if you look at an implementation of a console that uses the scrollback, like codex, it's insanely easy to corrupt and garble the output and scrollback just by resizing your terminal. This way is better but IMO it should not have even shipped without a search feature...

  13. DebelToni commented on Jan 31, 2026

    @DebelToni
    DebelToni
    on Jan 31, 2026
    More actions

    Because if you look at an implementation of a console that uses the scrollback, like codex, it's insanely easy to corrupt and garble the output and scrollback just by resizing your terminal. This way is better but IMO it should not have even shipped without a search feature...

    You are completely right! Thanks. Until something is merged I use /export without saving and then find what I need in Neovim

    Reacted by Johann Pardanaud and SOFe (Jonathan Chan Kwan Yin)
  14. nesk commented on Jan 31, 2026

    @nesk
    nesk
    on Jan 31, 2026
    More actions

    Until something is merged I use /export without saving and then find what I need in Neovim

    Well, I'm embarrassed I've never thought about this workaround before. Thank you.

  15. unphased commented on Feb 1, 2026

    @unphased
    unphased
    on Feb 1, 2026
    More actions

    Thank you, knowing about /export helps me too.

  16. 24 remaining items

  17. simonklee
    self-assigned this
    on Sep 17, 2026
  18. hunterchristian
    added a commit that references this issue on Sep 23, 2026

    feat(tui): add find-in-session search

    990038a
  19. cep207 commented on Oct 1, 2026

    @cep207
    cep207
    on Oct 1, 2026
    More actions

    Same need here — in OpenCode Desktop.

    Use case: I keep daily status reports inside a single session. When I need to
    find the report for a specific date (e.g. "15.09.2026") weeks later, the only
    way today is to scroll back through thousands of lines — practically impossible.

    A Ctrl+F-style search in the session buffer (jump to match, next/prev,
    highlight) would fully cover it. Note this applies to the Desktop app too,
    not only the TUI — there is currently no way to search conversation history
    inside an open session there.

    Reacted by Radosław Gawryś, cwegener and Michail Theofilatos
  20. levontumanyan commented on Oct 6, 2026

    @levontumanyan
    levontumanyan
    on Oct 6, 2026
    More actions

    I'm interested in contributing in-session search for the OpenCode TUI. Before I start coding, could a core-team maintainer review the proposed behavior and advise on the design?

    My main requirement is that search covers the whole current session, not only the visible terminal viewport or currently rendered rows. I propose an incremental search with a match count, next/previous navigation, highlighted matches, and a jump that scrolls the TUI to each match, including matches outside the current viewport.

    Could you advise on a few scope questions?

    • Should search cover user and assistant text only, or tool output too? Should collapsed tool output be searchable?
    • Should it cover the complete session history, including older messages not currently loaded into the view?
    • Is there a preferred keybinding or interaction pattern for the TUI?
    • Is there an existing design direction or prior implementation you would like a contribution to follow?

    I saw the earlier attempt in #4898 and the discussion here about jumping to a result. I would make reliable navigation to the matched text part of the design, rather than only counting matches in rendered output. If this scope looks right, I can work up a focused implementation and tests.

  21. sim590 commented on Oct 6, 2026

    @sim590
    sim590
    on Oct 6, 2026
    More actions

    @levontumanyan: note that my implementation showed in a demo above already does what you are asking for (covering the whole session, the output of the LLM and user messages).

    Maintainers are obviously not considering this a priority, hence their silence.

    Since you seem to be interested in making efforts to make this work (even though maintainers give next to no sign of approval), you should have a look at my implementation on feat/session-search branch here. Or are you disregarding this approach already based on the demo above? Did you take a look before posting your message?

  22. levontumanyan commented on Oct 7, 2026

    @levontumanyan
    levontumanyan
    on Oct 7, 2026
    More actions

    @sim590 I simply hadn't noticed your implementation when I posted earlier. That was my oversight; I wasn't disregarding your work. Please don't assume I had seen it and dismissed it.

    I've now reviewed the feat/session-search branch and agree it's a useful starting point. My earlier questions were about getting design feedback before contributing, not asking you to prove the feature is worthwhile. Searching the currently loaded session is fine for my immediate need; I understand the history limit can be addressed separately.

    Thanks for pointing me to the branch. I appreciate the implementation and the demo.

  23. arefdsg commented on Oct 22, 2026

    @arefdsg
    arefdsg
    on Oct 22, 2026
    More actions

    61. @sim590 I simply hadn't noticed your implementation when I posted earlier. That was my oversight; I wasn't disregarding your work. Please don't assume I had seen it and dismissed it.
    I've now reviewed the feat/session-search branch and agree it's a useful starting point. My earlier questions were about getting design feedback before contributing, not asking you to prove the feature is worthwhile. Searching the currently loaded session is fine for my immediate need; I understand the history limit can be addressed separately.
    Thanks for pointing me to the branch. I appreciate the implementation and the demo.

    you should reply yourself instead of having the AI write the replies for you

    Reacted by viktorashi
  24. viktorashi commented on Oct 22, 2026

    @viktorashi
    viktorashi
    on Oct 22, 2026
    More actions

    31. > 61. @sim590 I simply hadn't noticed your implementation when I posted earlier. That was my oversight; I wasn't disregarding your work. Please don't assume I had seen it and dismissed it.
    > I've now reviewed the feat/session-search branch and agree it's a useful starting point. My earlier questions were about getting design feedback before contributing, not asking you to prove the feature is worthwhile. Searching the currently loaded session is fine for my immediate need; I understand the history limit can be addressed separately.
    > Thanks for pointing me to the branch. I appreciate the implementation and the demo.

     you should reply yourself instead of having the AI write the replies for you
    

    honestly be nice to them, they have to maintain 2 versions of opencode in parallel now =))

  25. moritzWa commented on Oct 22, 2026

    @moritzWa
    moritzWa
    on Oct 22, 2026
    More actions

    Porting this to v2, as asked on the closed v1 PR (#53589, which got an LGTM review before the v1 branch closed). It already runs on v2 in my fork. Demo: https://raw.githubusercontent.com/moritzWa/opencode/pr-assets/search-demo.gif

    What it does: <leader>f / /search opens a bar; matches are highlighted in place in user messages and assistant markdown (tables included), enter/↓ and ↑ scroll to the exact line, Esc clears. Smart case, plain text. Tool and bash output are not searched, and only loaded messages are reachable.

    Design question before I open a v2 PR: this needs to scroll the transcript to a match and decorate rendered text in place, which a TUI plugin can't do today. Would you take it as a native TUI feature, or would you rather have a plugin API for scroll-to-row and text highlights first?

    Reacted by cwegener and Leandro Lucarella
  26. vshulcz commented on Oct 25, 2026

    @vshulcz
    vshulcz
    on Oct 25, 2026
    More actions

    /export and a grep still works today, and the text of every session is already in ~/.local/share/opencode/opencode.db, so it can be searched from outside the TUI. i built a small cli that indexes it, and deja search --harness opencode "15.09.2026" lists the matching sessions with the lines and the session id: https://github.com/vshulcz/deja-vu

  27. opencodejr commented on Oct 29, 2026

    @opencodejr
    opencodejrBot
    on Oct 29, 2026
    Contributor
    More actions

    Thanks for the request, @cwegener! You're asking for a find-in-session search in the TUI: look up a string anywhere in the current session's transcript (agent output and your messages) and jump between matches, much like / in vim or tmux copy mode.

    The v2 TUI doesn't have this yet. Maintainers will consider it. Related work and issues:

    • feat(tui): find in session with in-place highlights #53589: the closed v1 PR for in-session search; @moritzWa is porting it to v2 (see the comments above)
    • feat(tui): search in messages in session #4898: an earlier community implementation
    • feat: Copy Mode for OpenCode #2755: a vim/tmux-style copy mode, which would also cover finding and selecting text
    • 🚀 Feature Request: Add Quick Session Search Interface (Ctrl+K) #3361: a quick session search (Ctrl+K), which searches across sessions rather than inside one

    For now, the workaround mentioned above still works: run /export and search the exported transcript in your editor.

    This can't be built as a TUI plugin yet. A plugin can read the session's messages, but it has no way to scroll the session view to a match or highlight it.

  28. balabommablock-cpu commented on Oct 31, 2026

    @balabommablock-cpu
    balabommablock-cpu
    on Oct 31, 2026
    More actions

    A short map of where this stands, since the open question now is "native, or plugin API first?" (@moritzWa's comment).

    Tried so far: #4898 (Ctrl+F, whole-message matches), #34297 (dialog), #36526 (inline Ctrl+R), #53589 (v1, got an LGTM, closed with the v1 branch), and @sim590's feat/session-search branch. They differ in UI (dialog, inline bar, Ctrl+R) but agree on the core: type, see matches, jump next and previous. So the UX is mostly settled. What's blocking is where the code lives.

    The gap is two small things, not search itself. @simonklee said plugins are the preferred route but can't jump to a result, and the bot reply above confirms it: a plugin can read messages but can't scroll the session view or mark text. So the smallest unblock might be two plugin primitives:

    1. scrollTo(messageID, partID, line?): bring a part into view.
    2. highlight(ranges) / clearHighlights(): decorate rendered text without changing it.

    Search then ships as a built-in plugin (the #53589 port fits almost as is), and the same two calls cover other asks in this thread for free: jump to an earlier prompt (@Mehdi-afs's /prompts idea), jump to the last error, bookmarks.

    Scope for v1, answering @levontumanyan's questions with what the existing attempts already do:

    • Search user and assistant text. Leave tool and bash output out for now; it's noisy and often collapsed.
    • Loaded messages only, but say so: "3 matches in loaded messages" rather than a silent miss on older history.
    • /search plus one keybind, Enter / Shift+Enter for next and previous, Esc returns to where you were.

    If a maintainer can pick "two primitives first" or "native first", I think the port is ready to go either way.

  29. delaysystem commented on Nov 10, 2026

    @delaysystem
    delaysystem
    on Nov 10, 2026
    More actions

    #53589 implemented this for V1 and was closed only because V1 is frozen. I'd like to port it to V2. Before I start: is the in-place-highlight approach from that PR still the design you'd take, or should the V2 version look different?

  30. mindxploit commented on Nov 13, 2026

    @mindxploit
    mindxploit
    on Nov 13, 2026
    More actions

    Two things not covered above.

    Keybinding (asked twice in this thread, still unanswered): super+f is deliverable on v2 today, and it's the key people reach for first. OpenTUI negotiates the kitty keyboard protocol and its parser exposes super/hyper; cli.json already accepts super+… (input.select.all defaults to super+a). The blocker is the terminal, not the TUI — Ghostty 1.4.0 binds super+f=start_search by default, so it needs keybind = super+f=unbind (nothing lost; terminal find can't see an alt-screen app). iTerm2/Terminal.app would need a key remap to send the sequence.

    So: super+f on macOS, ctrl+f elsewhere, scoped to the session view so the prompt keeps ctrl+f = move-right, with /search and @moritzWa's <leader>f as the config-free path. Not ctrl+shift+f: Windows Terminal and the common Linux terminals reserve it for their own find, so it never reaches the app.

    Answering @cwegener's open question (can the minimal TUI load a historical session into the primary screen): it already does. opencode mini --session <id> replays that session into normal scrollback — checked on v2.3.0 against an old session — so terminal find works on past sessions today, no /export needed. Caveat: mini.replay_limit defaults to 200 messages.

    Env: v2.3.0, macOS 24.6.0 arm64, Ghostty 1.4.0.

  31. neriousy
    closed this as completedin #64870on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @simonklee
    simonklee

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

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.