-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1.21.1091 Canary] Terminal crashes on launch #17089
Comments
Okay first off: The |
We've discussed this over here: #16611 (comment) |
Mmk, lemme know when you've got a fix ready. My half assed fix was: diff --git a/src/cascadia/TerminalControl/TermControl.cpp b/src/cascadia/TerminalControl/TermControl.cpp
index acab82931..1692a981a 100644
--- a/src/cascadia/TerminalControl/TermControl.cpp
+++ b/src/cascadia/TerminalControl/TermControl.cpp
@@ -3569,19 +3569,21 @@ namespace winrt::Microsoft::Terminal::Control::implementation
winrt::fire_and_forget TermControl::_coreUpdateSearchResults(const IInspectable& /*sender*/, Control::UpdateSearchResultsEventArgs args)
{
co_await wil::resume_foreground(Dispatcher());
- if (auto automationPeer{ Automation::Peers::FrameworkElementAutomationPeer::FromElement(*this) })
- {
- automationPeer.RaiseNotificationEvent(
- Automation::Peers::AutomationNotificationKind::ActionCompleted,
- Automation::Peers::AutomationNotificationProcessing::ImportantMostRecent,
- args.FoundMatch() ? RS_(L"SearchBox_MatchesAvailable") : RS_(L"SearchBox_NoMatches"), // what to announce if results were found
- L"SearchBoxResultAnnouncement" /* unique name for this group of notifications */);
- }
- _UpdateSearchScrollMarks();
if (_searchBox)
{
+ if (auto automationPeer{ Automation::Peers::FrameworkElementAutomationPeer::FromElement(*this) })
+ {
+ automationPeer.RaiseNotificationEvent(
+ Automation::Peers::AutomationNotificationKind::ActionCompleted,
+ Automation::Peers::AutomationNotificationProcessing::ImportantMostRecent,
+ args.FoundMatch() ? RS_(L"SearchBox_MatchesAvailable") : RS_(L"SearchBox_NoMatches"), // what to announce if results were found
+ L"SearchBoxResultAnnouncement" /* unique name for this group of notifications */);
+ }
+
+ _UpdateSearchScrollMarks();
+
_searchBox->NavigationEnabled(true);
if (args.State() == Control::SearchState::Inactive)
{ but I've got a consistent repro of the crash, so just lemme know |
@AvogatoWizardWhisker can you file a new issue for that hang/crash on shutdown? adding your settings & state.json will probably be helpful for debugging. I want to make sure that gets sorted separately before the 1.21 release |
This PR extends `til::throttled_func` to also support debouncing: * throttling: "At most 1 call every N seconds" * debouncing: "Exactly 1 call after N seconds of inactivity" Based on the latter the following series of changes were made: * An `OutputIdle` event was added to `ControlCore` which is raised once there hasn't been any incoming data in 100ms. This also triggers an update of our regex patterns (URL detection). * The event is then caught by `TermControl` which calls `Search()`. * `Search()` in turn was modified to return its results by-value as a struct, which avoids the need for a search-update event and simplifies how we update the UI. This architectural change, most importantly the removal of the `TextLayoutUpdated` event, fixes a DoS bug in Windows Terminal: As the event leads to UI thread activity, printing lots of text continuously results in the UI thread becoming unresponsive. On top of these, a number of improvements were made: * `IRenderEngine::InvalidateHighlight` was changed to take the `TextBuffer` by-reference which avoids the need to accumulate the line renditions in a `std::vector` first. This improves Debug build performance during reflow by what I guess must be roughly a magnitude faster. This difference is very noticeable. * When closing the search box, `ClearSearch()` is called to remove the highlights. The search text is restored when it's reopened, however the current search position isn't. Closes #17073 Closes #17089 ## Validation Steps Performed * UIA announcements: * Pressing Ctrl+Shift+F the first time does not lead to one ✅ * Typing the first letter does ✅ * Closing doesn't ✅ * Reopening does (as it restores the letter) ✅ * Closing the search box dismisses the highlights ✅ * Resizing the window recalculates the highlights ✅ * Changing the terminal output while the box is open recalculates the highlights ✅
Methinks it's an explosion in the merge between #16611 and #17067
Useless stack:
terminal/src/cascadia/TerminalControl/TermControl.cpp
Lines 3569 to 3595 in 4e7b63c
The text was updated successfully, but these errors were encountered: