示例#1
0
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
	}
}
示例#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)
}