Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 24 lines (18 sloc) 0.355 kb
eee65c96 » bigwhoop
2012-10-02 added +build constraint for convert_unix.go
1 // +build darwin freebsd linux netbsd openbsd
2
fc6548b2 » Jesse van den Kieboom
2012-09-03 Wrap help text to terminal width
3 package flags
4
5 import (
6 "syscall"
7 "unsafe"
8 )
9
10 type winsize struct {
5f56c1f2 » Jesse van den Kieboom
2012-09-03 Run gofmt
11 ws_row, ws_col uint16
fc6548b2 » Jesse van den Kieboom
2012-09-03 Wrap help text to terminal width
12 ws_xpixel, ws_ypixel uint16
13 }
14
15 func getTerminalColumns() int {
5f56c1f2 » Jesse van den Kieboom
2012-09-03 Run gofmt
16 ws := winsize{}
fc6548b2 » Jesse van den Kieboom
2012-09-03 Wrap help text to terminal width
17
18 syscall.Syscall(syscall.SYS_IOCTL,
5f56c1f2 » Jesse van den Kieboom
2012-09-03 Run gofmt
19 uintptr(0),
20 uintptr(0x5413),
21 uintptr(unsafe.Pointer(&ws)))
fc6548b2 » Jesse van den Kieboom
2012-09-03 Wrap help text to terminal width
22
23 return int(ws.ws_col)
24 }
Something went wrong with that request. Please try again.