Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fire and forget Hyperlink handling to break deadlock (#8087)
Fire and forget on the hyperlink handler inside the TermControl. ## PR Checklist * [x] Closes #7994 * [x] Tested manually * [x] Hi, I work here. ## Detailed Description of the Pull Request / Additional comments In `TermControl`, `_HyperlinkHandler` is called by `_PointerPressedHandler` which has taken a write lock for all its friends. However, `_HyperlinkHandler` downstreams to `ShellExecute` which can pump the message queue looking for something. That pumping of the queue can trigger messages that also want the write lock to update state. They get stuck. Everything hangs. `_HyperlinkHandler` really only needs read lock and really only for as long as it takes to fill up its parameters before it's invoked... but the simpler and more contained solution is to just fire and forget the rest of the method that causes the deadlock to a continuation at the tail of the dispatcher queue so `_PointerPressedHandler` can complete and naturally drop the write lock. ## Validation Steps Performed - Launched `main` manually on my box and clicked the hyperlink that is detected when Powershell starts and it froze. - Launched this change manually on my box and clicked the hyperlink that is detected when Powershell starts and it did not freeze.
- Loading branch information