Documentation
¶
Overview ¶
Package termutil detects terminal constraints for output layout. It owns one thing: translating a writer into a content width budget.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContentWidth ¶
ContentWidth returns the usable content width for rows written to w.
Detection order:
- Terminal size from w if it is an *os.File connected to a TTY.
- $COLUMNS env var — set by most shells, survives pipes and subshells.
- layout.DefaultContentWidth — safe fallback for CI pipes and file output.
Width is derived from w itself first so it behaves correctly when output is redirected or captured, while $COLUMNS provides the actual terminal hint when the writer is a pipe (e.g. `stagefreight ci run docs | tee log.txt`).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.