1
0
forked from x/icebergs
icebergs/base/ssh/service_darwin.go
2020-09-29 02:42:01 +08:00

16 lines
328 B
Go

package ssh
import (
"encoding/binary"
"syscall"
"unsafe"
)
func _ssh_size(fd uintptr, b []byte) {
w := binary.BigEndian.Uint32(b)
h := binary.BigEndian.Uint32(b[4:])
ws := &Winsize{Width: uint16(w), Height: uint16(h)}
syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(syscall.TIOCSWINSZ), uintptr(unsafe.Pointer(ws)))
}