XtermTerminalDriver class
A AnsiTerminalDriver for the browser, backed by an xterm.js TerminalView.
The omnyshell :ide engine renders into a ScreenBuffer each frame; the
shared AnsiTerminalDriver base turns those frames into alt-screen / SGR /
cursor ANSI (identical to the native TTY driver). This subclass only supplies
the browser specifics: write the bytes to xterm.js, report its size, and
expose the host-forwarded keystroke stream and resize events. xterm.js
implements the alternate screen (?1049) and DEC private modes, so the
engine's output renders unchanged.
Constructors
-
XtermTerminalDriver({required TerminalView term, required Stream<
List< input, required Stream<int> >void> resizeEvents}) -
Creates a driver over
term.inputis the raw keystroke stream the host forwards while the IDE owns the screen (seeWebShellHost.runFullScreen);resizeEventsfires when the terminal's column/row count changes.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
input
→ Stream<
List< int> > -
The raw input byte stream.
no setter
-
resizeEvents
→ Stream<
void> -
Terminal resize notifications.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → ({int cols, int rows})
-
The current size in cells.
no setter
Methods
-
enter(
) → void -
Enters full-screen mode (alternate screen + raw input).
inherited
-
invalidate(
) → void -
Forces the next present to repaint in full.
inherited
-
leave(
) → void -
Leaves full-screen mode, restoring the prior screen and input mode.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onEnter(
) → void -
Hook run during
enter, before the alternate-screen sequence is written (e.g. enable raw mode / disable flow control). Default: no-op.inherited -
onLeave(
) → void -
Hook run during
leave, after the screen-restore sequence is written (e.g. restore the previous input mode). Default: no-op.inherited -
present(
ScreenBuffer frame, {int? cursorX, int? cursorY}) → void -
Renders
frame, diffed against the previous one, optionally placing the hardware cursor.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
writeAnsi(
String ansi) → void -
Writes
ansi(already-encoded escape/text) to the underlying terminal.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited