term

package
v1.138.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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