We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df424e6 commit 50e3fecCopy full SHA for 50e3fec
pty/pty_windows.go
@@ -169,6 +169,10 @@ func (p *ptyWindows) Close() error {
169
func (p *windowsProcess) waitInternal() {
170
defer func() {
171
// close the pseudoconsole handle when the process exits, if it hasn't already been closed.
172
+ // this is important because the PseudoConsole (conhost.exe) holds the write-end
173
+ // of the output pipe. If it is not closed, reads on that pipe will block, even though
174
+ // the command has exited.
175
+ // c.f. https://devblogs.microsoft.com/commandline/windows-command-line-introducing-the-windows-pseudo-console-conpty/
176
p.pw.closeMutex.Lock()
177
defer p.pw.closeMutex.Unlock()
178
if p.pw.console != windows.InvalidHandle {
0 commit comments