Terminal IO abstracted for testability.
The real implementation (in bin/fah.dart) binds lines to stdin,
write/writeln to stdout, and interrupts to SIGINT; tests substitute
scripted lines and capture output in memory.
The two output methods are separate channels: write carries the primary stream (assistant text deltas, the input prompt), writeln carries one-line diagnostics (tool indicators, notices, errors). The interactive terminal merges both on stdout; a headless host routes writeln to stderr so stdout stays pipeable.
- Implementers
Properties
- columns → int
-
Terminal width in columns. Non-TUI hosts use the 80-column default.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
interrupts
→ Stream<
void> -
Cancel signals (Ctrl-C). Each event aborts the current run.
no setter
- isInteractive → bool
-
Whether a human is present to answer approval prompts (a real terminal,
not piped input). When false, prompt-policy tool calls are denied with
a reason — the safe non-interactive default.
no setter
-
keys
→ Stream<
KeyEvent> -
Raw key events when the terminal is in raw mode. Non-raw hosts (tests,
headless, web) provide an empty stream.
no setter
-
lines
→ Stream<
String> -
User-typed input lines, without the trailing newline.
no setter
- rows → int
-
Terminal height in rows. Non-TUI hosts use the 24-row default.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- supportsRawMode → bool
-
Whether the underlying terminal supports raw-mode character input with
ANSI escape sequences. True for dart:io terminals; false for tests.
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
write(
String text) → void -
Writes
textwithout a trailing newline (streaming deltas). -
writeln(
String text) → void -
Writes
textfollowed by a newline.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited