TestTerminal class

A mock terminal for testing purposes.

This terminal does not interact with the actual terminal. Instead, it provides configurable dimensions and captures all output for verification in tests.

Inheritance

Constructors

TestTerminal({int width = 80, int height = 24})
Creates a test terminal with the specified dimensions.

Properties

flowControl ↔ bool
Whether software flow control (XON/XOFF) is enabled.
getter/setter pairoverride
hashCode → int
The hash code for this object.
no setterinherited
height → int
Get height of terminal in rows.
final
input → Stream<List<int>>
Broadcast stream of raw terminal input bytes.
no setteroverride
inputEvents → Stream<InputEvent>
Stream of parsed input events.
latefinal
interrupt → Stream<ProcessSignal>
Stream of interrupt (Ctrl+C) events.
no setteroverride
output → StringBuffer
Buffer containing all written output.
final
rawMode ↔ bool
Get the current raw mode state.
getter/setter pairoverride
resize → Stream<ProcessSignal>
Stream of terminal resize events.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
width → int
Get width of terminal in columns.
final

Methods

clearOutput() → void
Clear the output buffer.
dispose() → Future<void>
Close the input and resize stream controllers.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sendBytes(List<int> bytes) → void
Simulate raw byte input.
sendInput(String input) → void
Simulate keyboard input.
sendInterrupt() → void
Simulate an interrupt (Ctrl+C) event.
sendResize() → void
Simulate a terminal resize event.
takeOutput() → String
Get the output as a string and clear the buffer.
toString() → String
A string representation of this object.
inherited
write(Object? object) → void
Write to the terminal output.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited