Teach TerminalPage to handle exceptions that happen during paste (#5856)
Terminal should try not to join the choir invisible when the clipboard API straight up horks it. This accounts for ~3% of the crashes seen in 1.0RC1 and ~1% of the crashes seen all-up in the last 14 days. ## Repro (prior to this commit) Set `"copyOnSelect": true`. Copy something small. Hold down <kbd>Ctrl+Shift+V</kbd> Double-click like your life depends on it. Double-click like you're playing cookie clicker again. 2013 called, it wants its cookies back. Fixes #4906.
This commit is contained in:
parent
fcd5bb39f0
commit
a99c812794
|
@ -1448,12 +1448,16 @@ namespace winrt::TerminalApp::implementation
|
|||
// will crash on the UI thread, because the main thread is a STA.
|
||||
co_await winrt::resume_background();
|
||||
|
||||
hstring text = L"";
|
||||
if (data.Contains(StandardDataFormats::Text()))
|
||||
try
|
||||
{
|
||||
text = co_await data.GetTextAsync();
|
||||
hstring text = L"";
|
||||
if (data.Contains(StandardDataFormats::Text()))
|
||||
{
|
||||
text = co_await data.GetTextAsync();
|
||||
}
|
||||
eventArgs.HandleClipboardData(text);
|
||||
}
|
||||
eventArgs.HandleClipboardData(text);
|
||||
CATCH_LOG();
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
|
|
Loading…
Reference in a new issue