mirror of
https://github.com/go-gitea/gitea.git
synced 2025-02-19 19:04:51 +02:00

* Use vendored go-swagger * vendor go-swagger * revert un wanteed change * remove un-needed GO111MODULE * Update Makefile Co-Authored-By: techknowlogick <matti@mdranta.net>
29 lines
386 B
Go
Vendored
29 lines
386 B
Go
Vendored
// +build !windows,!plan9,!solaris,!appengine
|
|
|
|
package flags
|
|
|
|
import (
|
|
"syscall"
|
|
"unsafe"
|
|
)
|
|
|
|
type winsize struct {
|
|
row, col uint16
|
|
xpixel, ypixel uint16
|
|
}
|
|
|
|
func getTerminalColumns() int {
|
|
ws := winsize{}
|
|
|
|
if tIOCGWINSZ != 0 {
|
|
syscall.Syscall(syscall.SYS_IOCTL,
|
|
uintptr(0),
|
|
uintptr(tIOCGWINSZ),
|
|
uintptr(unsafe.Pointer(&ws)))
|
|
|
|
return int(ws.col)
|
|
}
|
|
|
|
return 80
|
|
}
|