mirror of https://github.com/coder/coder.git
fix: Windows resize syscall using incorrect pointer (#1152)
Resizing of PTYs weren't working on Windows before, but they are now!
This commit is contained in:
parent
82552a9315
commit
fccd4fab96
|
@ -82,7 +82,11 @@ func (p *ptyWindows) Input() io.ReadWriter {
|
|||
}
|
||||
|
||||
func (p *ptyWindows) Resize(cols uint16, rows uint16) error {
|
||||
ret, _, err := procResizePseudoConsole.Call(uintptr(p.console), uintptr(cols)+(uintptr(rows)<<16))
|
||||
// Taken from: https://github.com/microsoft/hcsshim/blob/54a5ad86808d761e3e396aff3e2022840f39f9a8/internal/winapi/zsyscall_windows.go#L144
|
||||
ret, _, err := procResizePseudoConsole.Call(uintptr(p.console), uintptr(*((*uint32)(unsafe.Pointer(&windows.Coord{
|
||||
X: int16(rows),
|
||||
Y: int16(cols),
|
||||
})))))
|
||||
if ret != 0 {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue