Skip to content

debugger_ui: Enable search in debugger terminal panel - #56863

Merged
osiewicz merged 6 commits into
zed-industries:mainfrom
iamsushank:debugger-terminal-search
Oct 7, 2026
Merged

osiewicz merged 6 commits into
zed-industries:mainfrom
iamsushank:debugger-terminal-search

Conversation

@iamsushank

@iamsushank iamsushank commented May 15, 2026 •

Copy link
Copy Markdown
Contributor

When a debug session is running, pressing cmd-f (or using Edit → Find) in the terminal panel had no effect. Three things were missing:

  • The debugger panes never had a BufferSearchBar added to their toolbar, so there was no search UI to deploy.
  • SubView::as_searchable returned None for all item kinds, so even if a search bar were present it could not find a search target.
  • RunningState::render did not wrap its output with the pane search action handlers, so buffer_search::Deploy was never handled.

Fix all three:

  • Register BufferSearchBar on each debugger pane toolbar via the PaneSearchBarCallbacks global (same pattern as terminal_panel).
  • Implement SubView::as_searchable for Terminal kind, delegating to the inner TerminalView which already implements SearchableItem.
  • Wrap RunningState::render with wrap_div_with_search_actions so the Deploy action reaches the active pane's toolbar.
  • Add refresh_terminal_toolbars to re-fire toolbar.set_active_item when the terminal entity is set, covering the case where the Terminal tab was already active before the terminal was created. Only refreshes panes where the Terminal subview is currently the active item.

Add a test that verifies the active debugger pane toolbar has a BufferSearchBar after a session starts.

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Fixes #38409

Release Notes:

  • Fixed cmd-f search not working in the debugger terminal panel.

When a debug session is running, pressing cmd-f (or using Edit → Find)
in the terminal panel had no effect. Three things were missing:

- The debugger panes never had a BufferSearchBar added to their toolbar,
  so there was no search UI to deploy.
- SubView::as_searchable returned None for all item kinds, so even if a
  search bar were present it could not find a search target.
- RunningState::render did not wrap its output with the pane search
  action handlers, so buffer_search::Deploy was never handled.

Fix all three:
- Register BufferSearchBar on each debugger pane toolbar via the
  PaneSearchBarCallbacks global (same pattern as terminal_panel).
- Implement SubView::as_searchable for Terminal kind, delegating to the
  inner TerminalView which already implements SearchableItem.
- Wrap RunningState::render with wrap_div_with_search_actions so the
  Deploy action reaches the active pane's toolbar.
- Add refresh_terminal_toolbars to re-fire toolbar.set_active_item when
  the terminal entity is set, covering the case where the Terminal tab
  was already active before the terminal was created. Only refreshes
  panes where the Terminal subview is currently the active item.

Add a test that verifies the active debugger pane toolbar has a
BufferSearchBar after a session starts.
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label May 15, 2026
@zed-community-bot zed-community-bot Bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label May 15, 2026
@ChristopherBiscardi ChristopherBiscardi added the area:debugger Feedback for Zed's debugger label May 15, 2026
@joneepenk

This comment was marked as low quality.

@osiewicz
osiewicz enabled auto-merge October 7, 2026 13:48
@osiewicz

osiewicz commented Oct 7, 2026

Copy link
Copy Markdown
Member

Thank you! LGTM

@osiewicz osiewicz self-assigned this Oct 7, 2026
@osiewicz
osiewicz added this pull request to the merge queue Oct 7, 2026
Merged via the queue into zed-industries:main with commit cb73ee1 Oct 7, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:debugger Feedback for Zed's debugger cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Debugger: Can't search in debug output terminal

5 participants