libterm

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Blockquote

func Blockquote(s string, cols int) string

func FancyUIWrapText

func FancyUIWrapText(s string, padding int, secondLineIndent int) string

func MustRewrap

func MustRewrap(s string, cols int, pad int) string

func MustRewrapSense

func MustRewrapSense(s string, pad int) string

func Rewrap

func Rewrap(s string, cols, pad int) (string, error)

func RewrapPad

func RewrapPad(r io.Reader, w io.Writer, width, pad int) error

RewrapPad reads UTF‑8 text from r, wraps it, and writes it to w. Each line is indented by pad spaces; the total line length (padding + text) never exceeds width.

Paragraphs are separated by blank lines in the input and are preserved.

Example:

err := RewrapPad(os.Stdin, os.Stdout, 80, 4) // 4‑space indent

func TerminalWidthWithDefault

func TerminalWidthWithDefault() int

Types

type NotATerminalError

type NotATerminalError struct{}

func (NotATerminalError) Error

func (e NotATerminalError) Error() string

type TermDims

type TermDims struct {
	Width  int
	Height int
}

TermDims holds the dimensions of the terminal.

func GetTermDims

func GetTermDims() (*TermDims, error)

Jump to

Keyboard shortcuts

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