Search unblocking followups #3942
Labels
Area-TerminalControl
Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)
Issue-Task
It's a feature request, but it doesn't really need a major design.
Product-Terminal
The new Windows Terminal.
Resolution-Fix-Committed
Fix is checked in, but it might be 3-4 weeks until a release.
Milestone
Description of the new feature/enhancement
These are the follow-up works that worthen trying but are not blocking the Search project to be checked-in:
Proposed technical implementation details (optional)
Issue 2:
In the current implementation of search, case match and search direction information are stored in SearchBoxControl as Booleans and passed to TermControl through getter methods. Besides, "Shift + Enter" reverse search are implemented by temporarily change direction state value. These are not safe approaches and should be refactored.
One solution is to use a delegate.
delegate void SearchHandler(String query, Boolean forward, Boolean caseSensitive);
...
runtimeclass xxx {
event SearchHandler Search();
}
In this way, we do not have to create an object, and we do not even need to use TypedEventHandler.
Then, the consumer can still add a search handler like this:
searchBoxControl.Search([](hstring query, bool forward, bool caseSensitive) {
})
Issue 3:
TermControl is using PreviewKeyDown as the event handler for KeyDown events, which is applying a Tunneling strategy. In tunneling, the event will first received by the Root element in the XAML tree and then pass down to the element that triggers the event. Thus, an early return check is added in TermControl::_KeyDownHandler to make sure inputs from the search dialog is handled separately. However, it is worth trying if we can handle search dialog inputs in SearchBoxControl.
The text was updated successfully, but these errors were encountered: