Help us shape the future of Go! Take the 2026 Go Developer Survey

termsize

package
v0.38.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package termsize is a terminal geometry shared by the CLI and the host. It lives at the module root's internal/ rather than under host/internal so that cmd/ may import it: Go's internal rule confines host/internal to the tree under host/.

Index

Constants

View Source
const Max = 65535

Max is the largest dimension a pty winsize can carry: both fields are uint16 on every platform this runs on.

Variables

View Source
var Default = Size{Cols: 80, Rows: 24}

Default is the geometry a session opens with when nothing better is known. 80x24 is the only size every terminal application copes with.

Functions

This section is empty.

Types

type Size

type Size struct {
	Cols, Rows int
}

Size is a terminal geometry. The zero value means "unspecified".

func Parse

func Parse(s string) (Size, error)

Parse reads a COLSxROWS geometry.

func (Size) String

func (s Size) String() string

func (Size) Valid

func (s Size) Valid() bool

Valid reports whether both dimensions are usable. A half-specified size is not a size: opening a zero-column pty is worse than falling back.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL