term

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2025 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTerminal

func IsTerminal(f *os.File) bool

IsTerminal returns whether the given file is a terminal.

func ReadCharacter

func ReadCharacter(prompt string) (c byte, err error)

ReadCharacter reads a single character from the terminal with no echo. The prompt is ephemeral.

func ReadPublic

func ReadPublic(prompt string) (s []byte, err error)

ReadPublic reads a value from the terminal. The prompt is ephemeral.

func ReadSecret

func ReadSecret(prompt string) (s []byte, err error)

ReadSecret reads a value from the terminal with no echo. The prompt is ephemeral.

func WithTerminal

func WithTerminal(f func(in, out *os.File) error) error

WithTerminal runs f with the terminal input and output files, if available. WithTerminal does not open a non-terminal stdin, so the caller does not need to check if stdin is in use.

Types

This section is empty.

Jump to

Keyboard shortcuts

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