Skip to content

fix: Windows resize syscall using incorrect pointer #1152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: Windows resize syscall using incorrect pointer
Resizing of PTYs weren't working on Windows before,
but they are now!
  • Loading branch information
kylecarbs committed Apr 25, 2022
commit 8047c9f79d698a4e5fb0573b8ba16a7ed51a22e3
6 changes: 5 additions & 1 deletion pty/pty_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down