[PR #13758] Call UpdatePatternLocations from a background thread #29751

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

Original Pull Request: https://github.com/microsoft/terminal/pull/13758

State: closed
Merged: Yes


We have a number of theories why #12607 is happening, one of which is that
some GPU drivers somehow rely on Win32 messages or similar which we process
on the main thread. If we then try to acquire the console lock on the main
thread, while the GPU-driver thread itself is holding that lock, we've got
ourselves a deadlock. This PR makes this less likely by running the repeat
offender UpdatePatternLocations on a background thread instead.
We have a number of other locations which acquire the console lock on the
main thread and a thorough bug fix must be done in a different way.

Validation Steps Performed

  • After pasting an URL it gets underlined on hover
**Original Pull Request:** https://github.com/microsoft/terminal/pull/13758 **State:** closed **Merged:** Yes --- We have a number of theories why #12607 is happening, one of which is that some GPU drivers somehow rely on Win32 messages or similar which we process on the main thread. If we then try to acquire the console lock on the main thread, while the GPU-driver thread itself is holding that lock, we've got ourselves a deadlock. This PR makes this less likely by running the repeat offender `UpdatePatternLocations` on a background thread instead. We have a number of other locations which acquire the console lock on the main thread and a thorough bug fix must be done in a different way. ## Validation Steps Performed * After pasting an URL it gets underlined on hover ✅
claunia added the pull-request label 2026-01-31 09:36:42 +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#29751