mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-10 00:48:23 -06:00
Fix lock warning during ReturnResponse (#17266)
As reported here: https://github.com/microsoft/terminal/pull/16224#discussion_r1594849244 The underlying `WriteFile` call may block indefinitely and we shouldn't hold the terminal lock during that period.
This commit is contained in:
parent
9054c81934
commit
183a8956f6
@ -22,8 +22,9 @@ TRACELOGGING_DEFINE_PROVIDER(g_hCTerminalCoreProvider,
|
||||
|
||||
void Terminal::ReturnResponse(const std::wstring_view response)
|
||||
{
|
||||
if (_pfnWriteInput)
|
||||
if (_pfnWriteInput && !response.empty())
|
||||
{
|
||||
const auto suspension = _readWriteLock.suspend();
|
||||
_pfnWriteInput(response);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user