interactive

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 3 Imported by: 0

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

func IsTerminalWriter(w io.Writer) bool

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.

Jump to

Keyboard shortcuts

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