SIGN IN SIGN UP
microsoft / terminal UNCLAIMED

The new Windows Terminal and the original Windows console host, all in the same place!

0 0 94 C++

conhost: Unlock the console while tearing down during coniosrv focus evt (#19967)

With the rendering thread changes in #18632 and #19330, we strengthened
a requirement that render shutdown be done outside of the console lock.
This works on all platforms except OneCore, where ConIoSrv manages the
focus of multiple console windows and we need to explicitly order the
handling of tearing down and relinquishing device resources.

The old code (before #18632) used to wait for a whole second before
giving up.

Instead, let's just unlock the console to let the final frame drain out.

I created a synthetic repro: start two cmd sessions with a lot of
rendering load (`cmdd start cmd /c dir /s c:\`), and then run `cmdd date
/t` in a tight loop while tabbing between the console windows.

Before this fix, it hangs within a couple tens of date invocations. With
this fix, it does not hang at all.

Fixes MSFT-61354695
D
Dustin L. Howett committed
e6ea8ace6d02fedfed22aaa3dd36f34ebc007c48
Parent: 36fb444
Committed by GitHub <noreply@github.com> on 3/12/2026, 5:30:45 PM