[PR #14045] [MERGED] Show number of search results & positions of hits in scrollbar #29898

Open
opened 2026-01-31 09:37:30 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/14045
Author: @zadjii-msft
Created: 9/20/2022
Status: Merged
Merged: 9/5/2023
Merged by: @zadjii-msft

Base: mainHead: dev/migrie/fhl/search-marks


📝 Commits (10+)

  • fa06c6f Introduce search status
  • ff1558c Teach search box to update status when new output is written
  • 5391f4e Remove live-search feature flag
  • 81a4a31 Merge remote-tracking branch 'upstream/main' into 6319-search-status
  • 4ab4d41 Allow disabling navigation buttons in SearchBox
  • 4a2de19 Add Searching status to translation
  • fe59504 Run search in the background + itnroduce grace for next search
  • 1068f85 Merge branch 'main' into 6319-search-status
  • 8e5efb7 Introduce computation of required statusbox width
  • 160716d Reduce the value :)

📊 Changes

19 files changed (+383 additions, -24 deletions)

View changed files

📝 src/buffer/out/search.cpp (+23 -2)
📝 src/buffer/out/search.h (+6 -1)
📝 src/cascadia/TerminalControl/ControlCore.cpp (+39 -1)
📝 src/cascadia/TerminalControl/ControlCore.h (+5 -0)
📝 src/cascadia/TerminalControl/ControlCore.idl (+4 -0)
📝 src/cascadia/TerminalControl/EventArgs.h (+2 -0)
📝 src/cascadia/TerminalControl/EventArgs.idl (+2 -0)
📝 src/cascadia/TerminalControl/Resources/en-US/Resources.resw (+13 -1)
📝 src/cascadia/TerminalControl/SearchBoxControl.cpp (+158 -0)
📝 src/cascadia/TerminalControl/SearchBoxControl.h (+16 -0)
📝 src/cascadia/TerminalControl/SearchBoxControl.idl (+4 -0)
📝 src/cascadia/TerminalControl/SearchBoxControl.xaml (+11 -2)
📝 src/cascadia/TerminalControl/TermControl.cpp (+76 -11)
📝 src/cascadia/TerminalControl/TermControl.h (+4 -1)
📝 src/cascadia/TerminalControl/TermControl.xaml (+1 -0)
📝 src/cascadia/TerminalCore/Terminal.hpp (+3 -0)
📝 src/cascadia/TerminalCore/TerminalApi.cpp (+1 -1)
📝 src/cascadia/UnitTests_TerminalCore/ScrollTest.cpp (+12 -3)
📝 src/inc/til/winrt.h (+3 -1)

📄 Description

This is a resurrection of #8588. That PR became painfully stale after the ControlCore split. Original description:

Summary of the Pull Request

This is a PoC for:

  • Search status in SearchBox (aka number of matches + index of the current match)
  • Live search (aka search upon typing)

Detailed Description of the Pull Request / Additional comments

  • Introduced this optionally (global setting to enable it)
  • The approach is following:
    • Every time the filter changes, enumerate all matches
    • Upon navigation just take the relevant match and select it

I cleaned it up a bit, and added support for also displaying the positions of the matches in the scrollbar (if showMarksOnScrollbar is also turned on).

It's also been made SUBSTANTIALLY easier after #15858 was merged.

Similar to before, searching while there's piles of output running isn't perfect. But it's pretty awful currently, so that's not the end of the world.

Gifs below.

Co-authored-by: Don-Vito khvitaly@gmail.com


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/14045 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 9/20/2022 **Status:** ✅ Merged **Merged:** 9/5/2023 **Merged by:** [@zadjii-msft](https://github.com/zadjii-msft) **Base:** `main` ← **Head:** `dev/migrie/fhl/search-marks` --- ### 📝 Commits (10+) - [`fa06c6f`](https://github.com/microsoft/terminal/commit/fa06c6fa2f5334bd72bf3b9212c56e36485d5d95) Introduce search status - [`ff1558c`](https://github.com/microsoft/terminal/commit/ff1558c2722c76b94b42baacd81b83ac4b035a46) Teach search box to update status when new output is written - [`5391f4e`](https://github.com/microsoft/terminal/commit/5391f4e64b1651f04e94a35b874f63e5ca5306ab) Remove live-search feature flag - [`81a4a31`](https://github.com/microsoft/terminal/commit/81a4a3120c60dd675b14f70da447eecf710b5568) Merge remote-tracking branch 'upstream/main' into 6319-search-status - [`4ab4d41`](https://github.com/microsoft/terminal/commit/4ab4d416f05c24a4707ce614646a497b89880775) Allow disabling navigation buttons in SearchBox - [`4a2de19`](https://github.com/microsoft/terminal/commit/4a2de19375175d6a484e5219cb1294757478015f) Add Searching status to translation - [`fe59504`](https://github.com/microsoft/terminal/commit/fe59504d20e916a9fd085537dac144a89d2e0baf) Run search in the background + itnroduce grace for next search - [`1068f85`](https://github.com/microsoft/terminal/commit/1068f857b9dc2e4a42b81b767bbbd068a5889f07) Merge branch 'main' into 6319-search-status - [`8e5efb7`](https://github.com/microsoft/terminal/commit/8e5efb71bb9ab83478f364c24f417306ead55404) Introduce computation of required statusbox width - [`160716d`](https://github.com/microsoft/terminal/commit/160716d47b720c7ebc2aca935d5a822c9c227a9b) Reduce the value :) ### 📊 Changes **19 files changed** (+383 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `src/buffer/out/search.cpp` (+23 -2) 📝 `src/buffer/out/search.h` (+6 -1) 📝 `src/cascadia/TerminalControl/ControlCore.cpp` (+39 -1) 📝 `src/cascadia/TerminalControl/ControlCore.h` (+5 -0) 📝 `src/cascadia/TerminalControl/ControlCore.idl` (+4 -0) 📝 `src/cascadia/TerminalControl/EventArgs.h` (+2 -0) 📝 `src/cascadia/TerminalControl/EventArgs.idl` (+2 -0) 📝 `src/cascadia/TerminalControl/Resources/en-US/Resources.resw` (+13 -1) 📝 `src/cascadia/TerminalControl/SearchBoxControl.cpp` (+158 -0) 📝 `src/cascadia/TerminalControl/SearchBoxControl.h` (+16 -0) 📝 `src/cascadia/TerminalControl/SearchBoxControl.idl` (+4 -0) 📝 `src/cascadia/TerminalControl/SearchBoxControl.xaml` (+11 -2) 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+76 -11) 📝 `src/cascadia/TerminalControl/TermControl.h` (+4 -1) 📝 `src/cascadia/TerminalControl/TermControl.xaml` (+1 -0) 📝 `src/cascadia/TerminalCore/Terminal.hpp` (+3 -0) 📝 `src/cascadia/TerminalCore/TerminalApi.cpp` (+1 -1) 📝 `src/cascadia/UnitTests_TerminalCore/ScrollTest.cpp` (+12 -3) 📝 `src/inc/til/winrt.h` (+3 -1) </details> ### 📄 Description This is a resurrection of #8588. That PR became painfully stale after the `ControlCore` split. Original description: > ## Summary of the Pull Request > This is a PoC for: > * Search status in SearchBox (aka number of matches + index of the current match) > * Live search (aka search upon typing) > ## Detailed Description of the Pull Request / Additional comments > * Introduced this optionally (global setting to enable it) > * The approach is following: > * Every time the filter changes, enumerate all matches > * Upon navigation just take the relevant match and select it > I cleaned it up a bit, and added support for also displaying the positions of the matches in the scrollbar (if `showMarksOnScrollbar` is also turned on). It's also been made SUBSTANTIALLY easier after #15858 was merged. Similar to before, searching while there's piles of output running isn't _perfect_. But it's pretty awful currently, so that's not the end of the world. Gifs below. * closes #8631 (which is a bullet point in #3920) * closes #6319 Co-authored-by: Don-Vito <khvitaly@gmail.com> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:37:30 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#29898