Files
LearnGO/go/pkg/mod/github.com/go-delve/liner@v1.2.3-0.20231231155935-4726ab1d7f62/output_unix.go
T
2024-09-19 21:38:24 -04:00

21 lines
407 B
Go

//go:build linux || darwin || openbsd || freebsd || netbsd
// +build linux darwin openbsd freebsd netbsd
package liner
import (
"syscall"
"unsafe"
)
func (s *State) getColumns() bool {
var ws winSize
ok, _, _ := syscall.Syscall(syscall.SYS_IOCTL, uintptr(syscall.Stdout),
syscall.TIOCGWINSZ, uintptr(unsafe.Pointer(&ws)))
if int(ok) < 0 {
return false
}
s.columns = int(ws.col)
return true
}