terminal/src/cascadia
Michael Kitzan 3ac32af848 Converts Dispatcher().RunAsync to WinRT Coroutines (#4051)
<!-- 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)? -->
## Summary of the Pull Request
This PR turns all* instances of `Dispatcher().RunAsync` to WinRT coroutines 👌. 
This was good coding fodder to fill my plane ride ✈️. Enjoy your holidays everyone!

*With the exception of three functions whose signatures cannot be changed due to inheritance and function overriding in `TermControlAutomationPeer` [`L44`](https://github.com/microsoft/terminal/blob/master/src/cascadia/TerminalControl/TermControlAutomationPeer.cpp#L44), [`L58`](https://github.com/microsoft/terminal/blob/master/src/cascadia/TerminalControl/TermControlAutomationPeer.cpp#L58),  [`L72`](https://github.com/microsoft/terminal/blob/master/src/cascadia/TerminalControl/TermControlAutomationPeer.cpp#L72). 

<!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> 
## References

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [x] Closes #3919
* [x] 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
* [x] 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: #3919

<!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments
My thought pattern here was to minimally disturb the existing code where possible. So where I could, I converted existing functions into coroutine using functions (like in the [core example](https://github.com/microsoft/terminal/issues/3919#issue-536598706)). For ~the most part~ all instances, I used the format where [`this` is accessed safely within a locked scope](https://github.com/microsoft/terminal/issues/3919#issuecomment-564730620). Some function signatures were changed to take objects by value instead of reference, so the coroutines don't crash when the objects are accessed past their original lifetime. The [copy](https://github.com/microsoft/terminal/blob/master/src/cascadia/TerminalApp/TerminalPage.cpp#L1132) and [paste](https://github.com/microsoft/terminal/blob/master/src/cascadia/TerminalApp/TerminalPage.cpp#L1170) event handler entry points were originally set to a high priority; however, the WinRT coroutines don't appear to support a priority scheme so this priority setting was not preserved in the translation.

<!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
Compiles and runs, and for every event with a clear trigger repro, I triggered it to ensure crashes weren't introduced.
2020-01-10 03:29:49 +00:00
..
CascadiaPackage update to the latest MUX prerelease (#4024) 2019-12-19 18:16:07 +00:00
inc Apply audit mode to TerminalConnection/Core/Settings and WinCon… (#4016) 2020-01-03 10:44:27 -08:00
LocalTests_TerminalApp Fix a test that regressed during #3575 (#4143) 2020-01-07 15:18:04 -08:00
PublicTerminalCore Add experimental retro terminal effects (#3468) 2019-12-12 13:44:01 +00:00
TerminalApp Converts Dispatcher().RunAsync to WinRT Coroutines (#4051) 2020-01-10 03:29:49 +00:00
TerminalConnection Add WT_SESSION to WSLENV so it propagates into WSL (#4157) 2020-01-09 19:23:48 +00:00
TerminalControl Converts Dispatcher().RunAsync to WinRT Coroutines (#4051) 2020-01-10 03:29:49 +00:00
TerminalCore Fix flipped sense in TerminalDispatch::CursorPosition (#4113) 2020-01-06 14:45:20 -08:00
TerminalSettings Terminal uses system default for number of rows scrolled at a t… (#3575) 2020-01-06 09:39:02 -08:00
UnitTests_TerminalCore Terminal uses system default for number of rows scrolled at a t… (#3575) 2020-01-06 09:39:02 -08:00
ut_app update to the latest MUX prerelease (#4024) 2019-12-19 18:16:07 +00:00
WindowsTerminal Snap to character grid when resizing window (#3181) 2020-01-08 13:19:23 -08:00
WindowsTerminalUniversal Add internal branding corner to Universal terminal... (#4017) 2019-12-18 16:51:06 -08:00
WinRTUtils Apply audit mode to TerminalConnection/Core/Settings and WinCon… (#4016) 2020-01-03 10:44:27 -08:00
WpfTerminalControl consolidate PackageES versioning in /custom.props (#3672) 2019-11-25 11:29:40 -08:00
CascadiaResources.build.items Add Int, Dev and IntDev assets; switch to them (#4006) 2019-12-17 19:57:51 -08:00