TerminalBridge class final
Bridge controller for embedded terminal hosts such as xterm.js, sockets, or custom UI surfaces.
TerminalBridge wraps an EmbeddedTerminalBackend and exposes:
- output for terminal bytes emitted by the TUI runtime
- addInput / addInputString for forwarding host input to the runtime
- resize for reporting host viewport changes
- requestShutdown for forwarding close/interrupt events
This sits one level above EmbeddedTerminalBackend and provides the ergonomic surface most host integrations actually need.
Constructors
- TerminalBridge({TerminalDimensions initialSize = (width: 80, height: 24), bool supportsAnsi = true, bool isTerminal = true, ColorProfile colorProfile = ColorProfile.trueColor, ({bool useBackspace, bool useTabs}) movementCaps = (useTabs: false, useBackspace: true), Encoding inputEncoding = utf8})
- Creates a bridge backed by an EmbeddedTerminalBackend.
Properties
- backend ↔ EmbeddedTerminalBackend
-
The underlying embedded backend.
latefinal
- bufferedOutput → String
-
Buffered terminal output emitted so far.
no setter
- colorProfile → ColorProfile
-
The color capability profile of the bridged surface.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isTerminal → bool
-
Whether the bridged surface should be treated as terminal-like.
final
- movementCaps → ({bool useBackspace, bool useTabs})
-
Host-specific movement optimization hints.
final
-
output
→ Stream<
String> -
Stream of raw terminal output emitted by the program.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → TerminalDimensions
-
Current bridged viewport size in cells.
no setter
- supportsAnsi → bool
-
Whether ANSI/OSC sequences are supported on the bridged surface.
final
- terminal ↔ BackendTerminal
-
Terminal wrapper layered on top of backend.
latefinal
Methods
-
addInput(
List< int> bytes) → void - Forwards raw input bytes from the host into the runtime.
-
addInputString(
String text, {Encoding? encoding}) → void - Encodes and forwards host input text into the runtime.
-
clearBufferedOutput(
) → void - Clears the accumulated bufferedOutput.
-
dispose(
) → void - Disposes the bridge, closing the output stream and backend.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
requestShutdown(
) → void - Forwards a host shutdown/interrupt event to the runtime.
-
resize(
{required int width, required int height}) → void - Reports a host resize event to the runtime.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited