Documentation
¶
Overview ¶
Package interactive provides TTY-related helpers shared between the cli and strategy packages without inducing an import cycle (strategy cannot import cli).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanPromptInteractively ¶
func CanPromptInteractively() bool
CanPromptInteractively reports whether interactive confirmation prompts (huh forms, yes/no questions, etc.) can be shown. Returns false in CI, agent subprocesses that inherit a TTY but can't respond to prompts, and other environments without a controlling TTY.
When ENTIRE_TEST_TTY is set (to any value, including empty) it is treated as a test override and the result is determined solely by whether the value equals "1":
- ENTIRE_TEST_TTY=1 forces interactive mode on
- any other value (including empty) forces interactive mode off
- ENTIRE_TEST_TTY unset falls through to agent-env guards and /dev/tty probing. In that case the return value depends on the actual environment, so tests that need a specific answer should set ENTIRE_TEST_TTY explicitly rather than assume a non-interactive host.
func IsTerminalWriter ¶
IsTerminalWriter reports whether w is an *os.File backed by a terminal. Use for deciding on color, pager, progress bars, or other writer-scoped TTY formatting. For "can I prompt the user?" use CanPromptInteractively.
Types ¶
This section is empty.