Example #1
0
File: table.go Project: pgpst/pgpst
func init() {
	// do not enable UTF-8 per locale by default, breaks tests
	sz, err := term.GetSize()
	if err == nil && sz.Columns != 0 {
		MaxColumns = sz.Columns
	}
}
Example #2
0
func main() {
	size, err := term.GetSize()
	if err != nil {
		fmt.Fprintf(os.Stderr, "failed: %s\n", err)
		os.Exit(1)
	}

	fmt.Printf("Lines %d  Columns %d\n", size.Lines, size.Columns)
}