Skip to content

Commit fccd4fa

Browse files
authored
fix: Windows resize syscall using incorrect pointer (#1152)
Resizing of PTYs weren't working on Windows before, but they are now!
1 parent 82552a9 commit fccd4fa

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pty/pty_windows.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ func (p *ptyWindows) Input() io.ReadWriter {
8282
}
8383

8484
func (p *ptyWindows) Resize(cols uint16, rows uint16) error {
85-
ret, _, err := procResizePseudoConsole.Call(uintptr(p.console), uintptr(cols)+(uintptr(rows)<<16))
85+
// Taken from: https://github.com/microsoft/hcsshim/blob/54a5ad86808d761e3e396aff3e2022840f39f9a8/internal/winapi/zsyscall_windows.go#L144
86+
ret, _, err := procResizePseudoConsole.Call(uintptr(p.console), uintptr(*((*uint32)(unsafe.Pointer(&windows.Coord{
87+
X: int16(rows),
88+
Y: int16(cols),
89+
})))))
8690
if ret != 0 {
8791
return err
8892
}

0 commit comments

Comments
 (0)