[PR #3590] [MERGED] Search - add search box control and implement search experience #25440

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/3590
Author: @KaiyuWang16
Created: 11/15/2019
Status: Merged
Merged: 12/17/2019
Merged by: @undefined

Base: masterHead: dev/kawa/605-Search-Experice-Implementation-Add-SearchBoxControl-and-Search-Experience


📝 Commits (10+)

  • 66aeec0 Make search a shared component for conhost and terminal
  • 02a280c Remove inclusion of deprecated interface file
  • 030961e Code review changes, remove text buffer modification in Terminal
  • 7eb30f6 remove unreferenced objects to fix build errors
  • fd0090e Fix test failure, guarantee uiaData object is correctly initialized in Search
  • c45ef9c minor comment typo fix and format fix
  • eae5d88 Add SearchBoxControl user control
  • 1cdd414 do not add SearchBox to TermControl for now
  • 14586d8 First prototype of Search Experience
  • 9007f87 Add calculation to correctly locate searched text on the visible view

📊 Changes

28 files changed (+757 additions, -29 deletions)

View changed files

📝 doc/cascadia/SettingsSchema.md (+2 -1)
📝 src/buffer/out/search.cpp (+27 -7)
📝 src/buffer/out/search.h (+1 -1)
📝 src/cascadia/TerminalApp/AppActionHandlers.cpp (+7 -1)
📝 src/cascadia/TerminalApp/AppKeyBindingsSerialization.cpp (+2 -0)
📝 src/cascadia/TerminalApp/ShortcutActionDispatch.cpp (+5 -0)
📝 src/cascadia/TerminalApp/ShortcutActionDispatch.h (+1 -0)
📝 src/cascadia/TerminalApp/ShortcutActionDispatch.idl (+2 -0)
📝 src/cascadia/TerminalApp/TerminalPage.cpp (+15 -1)
📝 src/cascadia/TerminalApp/TerminalPage.h (+3 -0)
📝 src/cascadia/TerminalApp/defaults.json (+1 -0)
src/cascadia/TerminalControl/SearchBoxControl.cpp (+186 -0)
src/cascadia/TerminalControl/SearchBoxControl.h (+63 -0)
src/cascadia/TerminalControl/SearchBoxControl.idl (+17 -0)
src/cascadia/TerminalControl/SearchBoxControl.xaml (+183 -0)
📝 src/cascadia/TerminalControl/TermControl.cpp (+110 -0)
📝 src/cascadia/TerminalControl/TermControl.h (+15 -3)
📝 src/cascadia/TerminalControl/TermControl.idl (+2 -0)
📝 src/cascadia/TerminalControl/TerminalControl.vcxproj (+23 -0)
📝 src/cascadia/TerminalControl/TerminalControl.vcxproj.filters (+6 -0)

...and 8 more files

📄 Description

This is the PR for feature Search: #605
This PR includes the newly introduced SearchBoxControl in TermControl dir, which is the search bar for the search experience. And the codes that enable Search in Windows Terminal.

The PR that migrates the Conhost search module: https://github.com/microsoft/terminal/pull/3279
Spec (still actively updating): https://github.com/microsoft/terminal/pull/3299

PR Checklist

  • Closes Add fallback fonts to display more Unicode codepoints (#605)
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Requires documentation to be updated
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

These functionalities are included in the search experience.

  1. Search in Terminal text buffer.
  2. Automatic wrap-around.
  3. Search up or down switch by clicking different buttons.
  4. Search case sensitively/insensitively by clicking a button. S. Move the search box to the top/bottom by clicking a button.
  5. Close by clicking 'X'.
  6. Open search by ctrl + F.

When the searchbox is open, the user could still interact with the terminal by clicking the terminal input area.

While I already have the search functionalities, currently there are still some known to-do works and I will keep updating my PR:

  1. Optimize the search box UI, this includes:
    1) Theme adaptation. The search box background and font color
    should change according to the theme,
    2) Add background. Currently the elements in search box are all
    transparent. However, we need a background.
    3) Move button should be highlighted once clicked.
  2. Accessibility: search process should be able to performed without mouse. Once the search box is focused, the user should be able to navigate between all interactive elements on the searchbox using keyboard.

To test:

  1. checkout this branch.
  2. Build the project.
  3. Start Windows Terminal and press Ctrl+F
  4. The search box should appear on the top right corner.

🔄 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/3590 **Author:** [@KaiyuWang16](https://github.com/KaiyuWang16) **Created:** 11/15/2019 **Status:** ✅ Merged **Merged:** 12/17/2019 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dev/kawa/605-Search-Experice-Implementation-Add-SearchBoxControl-and-Search-Experience` --- ### 📝 Commits (10+) - [`66aeec0`](https://github.com/microsoft/terminal/commit/66aeec07ba1c6f0fa37162f5e3dfd8f6debcd597) Make search a shared component for conhost and terminal - [`02a280c`](https://github.com/microsoft/terminal/commit/02a280c61f8e67ad22a77516d53045c38461043a) Remove inclusion of deprecated interface file - [`030961e`](https://github.com/microsoft/terminal/commit/030961e6a3bd4bd4d2cf88e4167e2f202f4f3129) Code review changes, remove text buffer modification in Terminal - [`7eb30f6`](https://github.com/microsoft/terminal/commit/7eb30f604cdc0e6d4e94b21f92f12810cb942ab1) remove unreferenced objects to fix build errors - [`fd0090e`](https://github.com/microsoft/terminal/commit/fd0090e990bab1ecd7140eb963935b17dc09cf70) Fix test failure, guarantee uiaData object is correctly initialized in Search - [`c45ef9c`](https://github.com/microsoft/terminal/commit/c45ef9c69b9c587f7ae3e3ac61c75005663b5a7c) minor comment typo fix and format fix - [`eae5d88`](https://github.com/microsoft/terminal/commit/eae5d88465de0d9c144d803938056cba78881ea7) Add SearchBoxControl user control - [`1cdd414`](https://github.com/microsoft/terminal/commit/1cdd41492ffc9bec1c6b948eb09164ffd75d1186) do not add SearchBox to TermControl for now - [`14586d8`](https://github.com/microsoft/terminal/commit/14586d8fa67d5e49bf77e52fcd58c284d14f4c9f) First prototype of Search Experience - [`9007f87`](https://github.com/microsoft/terminal/commit/9007f877945eeb374d31f51ce412a1287c52e7d4) Add calculation to correctly locate searched text on the visible view ### 📊 Changes **28 files changed** (+757 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `doc/cascadia/SettingsSchema.md` (+2 -1) 📝 `src/buffer/out/search.cpp` (+27 -7) 📝 `src/buffer/out/search.h` (+1 -1) 📝 `src/cascadia/TerminalApp/AppActionHandlers.cpp` (+7 -1) 📝 `src/cascadia/TerminalApp/AppKeyBindingsSerialization.cpp` (+2 -0) 📝 `src/cascadia/TerminalApp/ShortcutActionDispatch.cpp` (+5 -0) 📝 `src/cascadia/TerminalApp/ShortcutActionDispatch.h` (+1 -0) 📝 `src/cascadia/TerminalApp/ShortcutActionDispatch.idl` (+2 -0) 📝 `src/cascadia/TerminalApp/TerminalPage.cpp` (+15 -1) 📝 `src/cascadia/TerminalApp/TerminalPage.h` (+3 -0) 📝 `src/cascadia/TerminalApp/defaults.json` (+1 -0) ➕ `src/cascadia/TerminalControl/SearchBoxControl.cpp` (+186 -0) ➕ `src/cascadia/TerminalControl/SearchBoxControl.h` (+63 -0) ➕ `src/cascadia/TerminalControl/SearchBoxControl.idl` (+17 -0) ➕ `src/cascadia/TerminalControl/SearchBoxControl.xaml` (+183 -0) 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+110 -0) 📝 `src/cascadia/TerminalControl/TermControl.h` (+15 -3) 📝 `src/cascadia/TerminalControl/TermControl.idl` (+2 -0) 📝 `src/cascadia/TerminalControl/TerminalControl.vcxproj` (+23 -0) 📝 `src/cascadia/TerminalControl/TerminalControl.vcxproj.filters` (+6 -0) _...and 8 more files_ </details> ### 📄 Description <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> This is the PR for feature Search: #605 This PR includes the newly introduced SearchBoxControl in TermControl dir, which is the search bar for the search experience. And the codes that enable Search in Windows Terminal. <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> The PR that migrates the Conhost search module: https://github.com/microsoft/terminal/pull/3279 Spec (still actively updating): https://github.com/microsoft/terminal/pull/3299 <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #605 * [ ] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Requires documentation to be updated * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> These functionalities are included in the search experience. 1. Search in Terminal text buffer. 2. Automatic wrap-around. 3. Search up or down switch by clicking different buttons. 4. Search case sensitively/insensitively by clicking a button. S. Move the search box to the top/bottom by clicking a button. 6. Close by clicking 'X'. 7. Open search by ctrl + F. When the searchbox is open, the user could still interact with the terminal by clicking the terminal input area. While I already have the search functionalities, currently there are still some known to-do works and I will keep updating my PR: 1. Optimize the search box UI, this includes: 1) Theme adaptation. The search box background and font color should change according to the theme, 2) Add background. Currently the elements in search box are all transparent. However, we need a background. 3) Move button should be highlighted once clicked. 2. Accessibility: search process should be able to performed without mouse. Once the search box is focused, the user should be able to navigate between all interactive elements on the searchbox using keyboard. <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> To test: 1. checkout this branch. 2. Build the project. 3. Start Windows Terminal and press Ctrl+F 4. The search box should appear on the top right corner. --- <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:09:31 +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#25440