diff --git a/base/ssh/server_darwin.go b/base/ssh/server_darwin.go new file mode 100644 index 00000000..266d3410 --- /dev/null +++ b/base/ssh/server_darwin.go @@ -0,0 +1,15 @@ +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))) +} diff --git a/base/ssh/server_linux.go b/base/ssh/server_linux.go new file mode 100644 index 00000000..266d3410 --- /dev/null +++ b/base/ssh/server_linux.go @@ -0,0 +1,15 @@ +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))) +} diff --git a/base/ssh/server_windows.go b/base/ssh/server_windows.go new file mode 100644 index 00000000..ca29f9b8 --- /dev/null +++ b/base/ssh/server_windows.go @@ -0,0 +1,4 @@ +package ssh + +func _ssh_size(fd uintptr, b []byte) { +}