mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 17:44:05 +08:00
opt ssh
This commit is contained in:
parent
dae75f4aab
commit
dfa411f65d
15
base/ssh/server_darwin.go
Normal file
15
base/ssh/server_darwin.go
Normal file
@ -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)))
|
||||||
|
}
|
15
base/ssh/server_linux.go
Normal file
15
base/ssh/server_linux.go
Normal file
@ -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)))
|
||||||
|
}
|
4
base/ssh/server_windows.go
Normal file
4
base/ssh/server_windows.go
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
package ssh
|
||||||
|
|
||||||
|
func _ssh_size(fd uintptr, b []byte) {
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user