termwidth

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package termwidth reports the terminal width attached to a stream so help output can wrap to it. It stays free of dynamic package-level initializers, keeping the package linkable and inert for binaries that never render help.

Index

Constants

View Source
const (
	// Default is the wrap width used when no terminal width is discoverable:
	// piped output, redirected files, buffers, and terminals that do not
	// report a size.
	Default = 100
)

Variables

This section is empty.

Functions

func Resolve

func Resolve(file *os.File) int

Resolve returns the width help output should wrap at: a COLUMNS environment value of at least minColumns wins, then the terminal width of file (nil or a non-terminal stream reports none), then Default.

Types

This section is empty.

Jump to

Keyboard shortcuts

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