term

package
v1.116.1 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package term holds small terminal-output helpers shared by pkg/cli's progress and spinner packages.

Index

Constants

View Source
const ClearLine = "\r\033[K"

ClearLine is the ANSI escape sequence that returns the cursor to the start of the current line and erases it, used to redraw a status line in place.

Variables

This section is empty.

Functions

func IsTerminal

func IsTerminal(f *os.File) bool

IsTerminal reports whether f is connected to a terminal.

func Width

func Width(f *os.File) (width int, ok bool)

Width returns f's current terminal column width, and whether it could be determined at all (e.g. f might not be a terminal). Callers that redraw a line in place should re-check this on every redraw rather than caching it, so output keeps fitting the terminal across resizes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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