term

package
v1.162.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTTYSupportForStderr added in v1.162.0

func IsTTYSupportForStderr() bool

CheckTTYSupportStderr checks if stderr supports TTY for displaying the progress UI.

func IsTTYSupportForStdout added in v1.162.0

func IsTTYSupportForStdout() bool

CheckTTYSupportStdout checks if stdout supports TTY for displaying the progress UI.

func NewResponsiveWriter

func NewResponsiveWriter(w io.Writer) io.Writer

NewResponsiveWriter creates a terminal-aware writer that automatically wraps text based on the terminal width. If the provided writer is not a terminal or if width detection fails, it will return the original writer unchanged.

Types

type TerminalWriter

type TerminalWriter struct {
	// contains filtered or unexported fields
}

TerminalWriter wraps an io.Writer and provides automatic line wrapping based on terminal width It ensures that output text is formatted to fit within the terminal's dimensions.

func (*TerminalWriter) GetWidth

func (w *TerminalWriter) GetWidth() uint

func (*TerminalWriter) Write

func (w *TerminalWriter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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