mirror of
https://github.com/neovim/neovim.git
synced 2026-03-30 04:12:01 +00:00
Problem: On Windows 10, the ConPTY closing order is strict. Calling ClosePseudoConsole after closing the output stream can easily lead to accidental deadlocks, leaving orphan conhost.exe processes. See https://learn.microsoft.com/en-us/windows/console/closepseudoconsole#remarks and https://learn.microsoft.com/en-us/windows/console/creating-a-pseudoconsole-session#ending-the-pseudoconsole-session Solution: Based on the warning in the docs above, we need to call ClosePseudoConsole on a separate thread first so that the output pipe can fully drain on the main thread. Also, `wait_eof_timer` is outdated, so I removed it to avoid extra cleanup logic around it (it was introduced in the early winpty days). Co-authored-by: Justin M. Keyes <justinkz@gmail.com>