Exception: Clack::NotATerminalError

Inherits:
IOError
  • Object
show all
Defined in:
lib/clack/errors.rb

Overview

Raised when a prompt needs keystrokes but its input stream is not an interactive terminal (for example, stdin is a pipe, a file, or /dev/null).

Inherits from IOError so existing rescue IOError guards keep working. The message names the fix: run from a terminal, or enable CI mode so prompts auto-submit their defaults.

Examples:

begin
  Clack.text(message: "Name?")
rescue Clack::NotATerminalError => e
  warn e.message
  exit 1
end