Documentation
¶
Overview ¶
Package chk provides some checked terminal utilities.
Index ¶
- Variables
- func IsColored(w io.Writer) bool
- func IsColorful(w io.Writer) (colorful bool)
- func IsTty(w io.Writer) bool
- func ReadTill(fd int, delim byte) (line string, delimMatched bool, err error)
- func StatStdout() (normalFile, redirected, piped, term bool)
- func StatStdoutString() (status string)
- func StdoutIsPiped() (b bool)
- func StringToBool(val string, defaultVal ...bool) (ret bool)
- func ToBool(val any, defaultVal ...bool) (ret bool)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EnvironmentOverrideColors bool = true DisableColors bool // no colorful paint? false to disable colorful paint. ForceColors bool // always colorful paint? true to enable colorful paint even if the underlying tty cannot support ANSI escaped sequences. MinVal int64 // 0,16,88,256, or 1<<24 )
Functions ¶
func IsColored ¶
IsColored detects a writer if it is a colorful tty device.
A colorful tty device can receive ANSI escaped sequences and draw its.
func IsColorful ¶
IsColorful detects a writer if it is a colorful tty device.
A colorful tty device can receive ANSI escaped sequences and draw its.
func ReadTill ¶
ReadTill reads a line or a string ending with delim of input from a terminal without local echo.
func StatStdout ¶
func StatStdout() (normalFile, redirected, piped, term bool)
func StatStdoutString ¶
func StatStdoutString() (status string)
func StdoutIsPiped ¶
func StdoutIsPiped() (b bool)
func StringToBool ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.