Skip to content

Commit e48d4ab

Browse files
committed
fix: pty close on Windows
1 parent dc86c9a commit e48d4ab

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pty/pty_windows.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,16 @@ func (p *ptyWindows) Close() error {
130130
return nil
131131
}
132132
p.closed = true
133-
_ = p.outputWrite.Close()
134-
_ = p.outputRead.Close()
135-
_ = p.inputWrite.Close()
136-
_ = p.inputRead.Close()
137133

138134
ret, _, err := procClosePseudoConsole.Call(uintptr(p.console))
139135
if ret < 0 {
140136
return xerrors.Errorf("close pseudo console: %w", err)
141137
}
142138

139+
_ = p.outputWrite.Close()
140+
_ = p.outputRead.Close()
141+
_ = p.inputWrite.Close()
142+
_ = p.inputRead.Close()
143143
return nil
144144
}
145145

pty/ptytest/ptytest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ type PTY struct {
126126
func (p *PTY) ExpectMatch(str string) string {
127127
p.t.Helper()
128128

129-
timeout, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
129+
timeout, cancel := context.WithTimeout(context.Background(), testutil.WaitMedium)
130130
defer cancel()
131131

132132
var buffer bytes.Buffer

0 commit comments

Comments
 (0)