Documentation
¶
Overview ¶
Package term reports whether stackit is attached to an interactive terminal and holds the process-wide interactive mode.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInteractiveDisabled = errors.New("interactive prompts are disabled (running with --no-interactive or not in a TTY)")
ErrInteractiveDisabled is returned when interactive prompts are disabled (running with --no-interactive or not in a TTY).
Functions ¶
func CheckInteractiveAllowed ¶
func CheckInteractiveAllowed() error
CheckInteractiveAllowed returns ErrInteractiveDisabled when interactive prompts are not available, and nil otherwise.
func IsInteractive ¶
func IsInteractive() bool
IsInteractive reports whether prompts and the TUI may be used: interactive mode is on and a usable terminal is attached.
func NonInteractiveEnv ¶
func NonInteractiveEnv() bool
NonInteractiveEnv reports whether STACKIT_NO_INTERACTIVE requests non-interactive mode. Any value other than empty/"0"/"false"/"no" enables it, letting agents and scripts opt out of prompts once instead of passing --no-interactive on every command.
func ReadStdin ¶
ReadStdin reads all piped standard input. It returns "" without blocking when stdin is a terminal or an empty file.
func SetInteractive ¶
func SetInteractive(interactive bool)
SetInteractive sets whether the TUI should be interactive
func TerminalDetected ¶
func TerminalDetected() bool
TerminalDetected reports whether a usable interactive terminal is attached, independent of the configured interactive mode. It checks the TERM environment, stdin/stdout isatty, and /dev/tty availability. Use this when resolving the default interactivity before the interactive mode is set (e.g. in the root command), where IsTTY's mode gate would not yet apply.
Types ¶
This section is empty.