JsonTerminalBackend class final

Message-oriented backend that speaks the terminal bridge JSON protocol.

Use this when the host transport already gives you discrete string or binary messages, such as websockets or structured IPC channels.

Implemented types

Constructors

JsonTerminalBackend({required void sendMessage(String message), required Stream<Object?> inboundMessages, Future<void> flushMessages()?, Future<void> closeTransport()?, 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)})
Creates a JSON protocol backend.

Properties

colorProfile ColorProfile
The color capability profile of the target surface.
final
hashCode int
The hash code for this object.
no setterinherited
inputStream Stream<List<int>>?
Stream of raw input bytes, if the backend accepts input.
no setteroverride
isRawMode bool
Whether raw mode is currently enabled.
no setteroverride
isTerminal bool
Whether the backend is connected to a real terminal-like surface.
final
movementCaps → ({bool useBackspace, bool useTabs})
final
resizeStream Stream<TerminalDimensions>?
Stream of terminal resize events, if the backend can emit them.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shutdownStream Stream<void>?
Stream of shutdown/interrupt events, if the backend can emit them.
no setteroverride
size TerminalDimensions
Current terminal dimensions.
no setteroverride
supportsAnsi bool
Whether the backend can interpret ANSI escape sequences.
final

Methods

disableRawMode() → void
Disables raw input mode.
override
dispose() → void
Disposes backend resources.
override
enableRawMode() RawModeGuard
Enables raw input mode.
override
flush() Future<void>
Flushes any buffered backend output.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
optimizeMovements() → ({bool useBackspace, bool useTabs})
Host-specific movement optimization hints.
override
toString() String
A string representation of this object.
inherited
writeRaw(String data) → void
Writes raw terminal data immediately.
override

Operators

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