debian/vendor/github.com/micro-editor/terminal/ioctl_posix.go
raw| 1 | //go:build linux || darwin || dragonfly || solaris || openbsd || netbsd || freebsd |
| 2 | |
| 3 | package terminal |
| 4 | |
| 5 | import ( |
| 6 | "golang.org/x/sys/unix" |
| 7 | ) |
| 8 | |
| 9 | func (t *VT) ptyResize() error { |
| 10 | if t.pty == nil { |
| 11 | return nil |
| 12 | } |
| 13 | w := &unix.Winsize{ |
| 14 | Row: uint16(t.dest.rows), |
| 15 | Col: uint16(t.dest.cols), |
| 16 | Xpixel: 16 * uint16(t.dest.cols), |
| 17 | Ypixel: 16 * uint16(t.dest.rows), |
| 18 | } |
| 19 | return unix.IoctlSetWinsize(int(t.pty.Fd()), unix.TIOCSWINSZ, w) |
| 20 | } |