term

package
v0.24.4 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 7 Imported by: 19

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IsTTY = term.IsTerminal(int(os.Stdout.Fd()))

IsTTY contains whether the stdout is a terminal.

Functions

func GetRawTTYEncoding

func GetRawTTYEncoding() encoding.Encoding

GetRawTTYEncoding returns the TTY encoding, or nil if not found.

func GetTTYEncoding

func GetTTYEncoding() encoding.Encoding

GetTTYEncoding returns the TTY encoding, or UTF-8 if not found.

func GetTTYEncodingName

func GetTTYEncodingName() string

GetTTYEncodingName returns the TTY encoding's name, or empty if not found.

func MaskIn

func MaskIn(in *os.File, enc encoding.Encoding) (*os.File, error)

MaskIn masks the input stream for Reads.

func MaskInOutTTY

func MaskInOutTTY() error

MaskInOutTTY mask os.Stdin, os.Stdout, os.Stderr with the TTY encoding, if any.

WARNING! This uses os pipes, so kernel buffering may cut the tail!

func MaskOut

func MaskOut(out *os.File, enc encoding.Encoding) (*os.File, error)

MaskOut masks the output stream forWrites.

WARNING! This uses os pipes, so kernel buffering may cut the tail!

func MaskStdoutErr

func MaskStdoutErr(enc encoding.Encoding) error

MaskStdoutErr masks os.Stdout and os.Stderr.

WARNING! This uses os pipes, so kernel buffering may cut the tail!

Types

This section is empty.

Jump to

Keyboard shortcuts

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