tty

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package tty provides utilities for TTY (terminal) detection. This package uses golang.org/x/term for TTY detection, which aligns with modern Go best practices and the spinner library v1.23.1+ implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInteractiveTerminal added in v0.1.16

func IsInteractiveTerminal() bool

IsInteractiveTerminal returns true if the process is running in an interactive terminal context: stderr is a terminal and the process is not running inside a container.

func IsRunningInContainer

func IsRunningInContainer() bool

IsRunningInContainer detects if the current process is running inside a container. Note: This package cannot use the logger package to avoid import cycles, since logger imports tty for terminal detection.

func IsStderrTerminal

func IsStderrTerminal() bool

IsStderrTerminal returns true if stderr is connected to a terminal.

func IsStdoutTerminal

func IsStdoutTerminal() bool

IsStdoutTerminal returns true if stdout is connected to a terminal.

func StderrTerminalWidth added in v0.1.16

func StderrTerminalWidth() (int, bool)

StderrTerminalWidth returns the width of the terminal connected to stderr and true if successful. Returns 0 and false if stderr is not a terminal or the width cannot be determined.

Types

This section is empty.

Jump to

Keyboard shortcuts

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