terminal library Ultraviolet
Terminal lifecycle, cursor, and native console integration.
Import this entrypoint when managing a terminal session. Lower-level frame
construction, input, and rendering APIs remain available from the focused
core.dart, input.dart, and rendering.dart entrypoints.
Classes
- Attr
- Text attributes (bitmask).
- BackgroundColorEvent
- Background color report.
- BlurEvent
- Terminal focus lost event.
- Buffer
- A 2D buffer of Lines representing a terminal screen or a portion of it.
- CapabilityEvent
- Capability string event (e.g., terminal features).
- Cell
- A single cell in a terminal Buffer.
- CellDiffOption
- Controls how a Cell participates in terminal-buffer diffing.
- CellSizeEvent
- Reports terminal cell size in pixels.
- ClearableScreen
- Optional fast-path: clear the entire screen.
- ClearAreaScreen
- Optional fast-path: clear an area of the screen.
- ClipboardEvent
- Clipboard selection and content (OSC 52).
- ClipboardSelection
- CloneableScreen
- Optional fast-path: clone the entire screen into a buffer.
- CloneAreaScreen
- Optional fast-path: clone a screen area into a buffer.
- ColorPaletteEvent
- Palette color report for an index.
- Cursor
- Represents a cursor on the terminal screen.
- CursorColorEvent
- Cursor color report.
- CursorPositionEvent
- Reports cursor position.
- DarkColorSchemeEvent
- Terminal reports dark color scheme preference.
- DirtyDensityMap
- Metadata for a touched line.
- DirtySpan
- Drawable
- Drawable can draw itself into a Screen.
- EmptyDrawable
- A no-op drawable with a fixed size.
- Event
- Base type for UV-style input events.
- FillableScreen
- Optional fast-path: fill the entire screen.
- FillAreaScreen
- Optional fast-path: fill an area of the screen.
- FocusEvent
- Terminal focus gained event.
- ForegroundColorEvent
- Foreground color report.
- HalfBlockImageDrawable
- A Drawable that renders an image using half-block characters.
- IgnoredEvent
- Internal marker for sequences intentionally ignored.
- ITerm2ImageDrawable
- A Drawable that renders an image using the iTerm2 Image Protocol.
- KeyboardEnhancementsEvent
- Kitty keyboard enhancements support report.
- KeyEvent
- Base type for key press/release events.
- KeyPressEvent
- Key press event.
- KeyReleaseEvent
- Key release event.
- KittyGraphicsEvent
-
Kitty graphics payload (APC
G ... ST). - KittyImageDrawable
- A Drawable that renders an image using the Kitty Graphics Protocol.
- KittyOptions
- Options parsed from a Kitty graphics report.
- LightColorSchemeEvent
- Terminal reports light color scheme preference.
- Line
- A line is a fixed-width list of cells.
- LineData
- Metadata for one dirty line.
- Link
- Terminal hyperlink metadata (OSC 8).
- LinkState
- Holds the parsed hyperlink URL from an OSC 8 sequence.
- ModeReportEvent
- Terminal mode report.
- ModifyOtherKeysEvent
- Xterm ModifyOtherKeys mode report.
- MouseClickEvent
- Mouse click event.
- MouseEvent
- Base type for mouse click/release/wheel/motion events.
- MouseMotionEvent
- Mouse motion (move/drag) event.
- MouseReleaseEvent
- Mouse button release event.
- MouseWheelEvent
- Mouse wheel (scroll) event.
- MultiEvent
- Aggregates multiple events decoded from a single input.
- OwnedCellScreen
- Optional fast-path: set a cell that the caller will not reuse.
- PackedCell
- Fixed-size packed representation of a Cell.
- PasteEndEvent
- Bracketed paste end.
- PasteEvent
- Bracketed paste content.
- PasteStartEvent
- Bracketed paste start.
- Position
- A 2D integer coordinate in terminal cell space.
- PrimaryDeviceAttributesEvent
- Primary device attributes (DA1) report.
- Rectangle
-
Rectangle with inclusive-exclusive bounds:
[min, max). - Screen
- Screen is a 2D surface of cells.
- ScreenBuffer
-
A screen buffer that implements
Screenoperations and carries a width method for calculating cell widths. - SecondaryDeviceAttributesEvent
- Secondary device attributes (DA2) report.
- SgrParam
- Represents a parsed SGR (Select Graphic Rendition) parameter.
- SixelImageDrawable
- A Drawable that renders an image using Sixel Graphics.
- Size
- Reports terminal size in cells and optional pixels.
- StyledString
- StyledString is a string that can be decomposed into a series of styled lines and cells.
- StyleState
- Holds the result of parsing an SGR sequence.
- Terminal
- Terminal represents a terminal screen that can be manipulated and drawn to.
- TerminalCapabilities
- Terminal capabilities discovered via ANSI queries.
- TerminalGraphicsControl
- One parsed terminal graphics control sequence.
- TerminalGraphicsFrame
- Retained graphics state visible in a rendered frame.
- TerminalVersionEvent
-
Terminal version string (e.g.,
xterm-kitty 0.32.0). - TertiaryDeviceAttributesEvent
- Tertiary device attributes (DA3) report.
- UnknownApcEvent
- Unknown APC event with raw payload.
- UnknownCsiEvent
- Unknown CSI event with raw payload.
- UnknownDcsEvent
- Unknown DCS event with raw payload.
- UnknownEvent
- Unknown event with raw payload.
- UnknownOscEvent
- Unknown OSC event with raw payload.
- UnknownPmEvent
- Unknown PM event with raw payload.
- UnknownSosEvent
- Unknown SOS event with raw payload.
- UnknownSs3Event
- Unknown SS3 event with raw payload.
- UvBasic16
- 16-color palette index (optionally bright).
- UvColor
- Color representation sufficient for Ultraviolet parity tests.
- UvIndexed256
- 256-color indexed palette entry.
- UvRgb
- 24-bit RGBA color.
- UvStyle
- Style attributes for a terminal Cell.
- WindowOpEvent
- Window operation report (OSC 7/11/… payloads).
- WindowPixelSizeEvent
- Reports window size in pixels.
- WindowSizeEvent
- Reports window size in cells and optional pixels.
Enums
- CursorShape
- Cursor shape primitives.
- ModeSetting
- TerminalGraphicsProtocol
- Terminal graphics protocols that can appear as display payloads.
- UnderlineStyle
- Underline style for terminal cells.
Extensions
Functions
-
containsRetainedTerminalGraphics(
String value) → bool -
Whether
valuecontains retained graphics. -
containsSixelDisplay(
String value) → bool -
Whether
valuecontains a Sixel display payload. -
containsTerminalGraphicsDisplay(
String value) → bool -
Whether
valuecontains any terminal graphics display sequence. -
debugGraphemeGeneration(
int id) → int -
Returns the encoded grapheme generation for
id. -
debugGraphemeRefCount(
int id) → int -
Returns the pooled grapheme refcount for
id. -
debugGraphemeSlot(
int id) → int -
Returns the encoded grapheme slot index for
id. -
debugGraphemeWidth(
int id) → int -
Returns the encoded grapheme width for
id. -
debugLinkGeneration(
int id) → int -
Returns the pooled link generation for
id. -
debugLinkRefCount(
int id) → int -
Returns the pooled link refcount for
id. -
debugLinkSlot(
int id) → int -
Returns the pooled link slot index for
id. -
deleteAllRetainedGraphics(
{int quiet = 2}) → String - Returns the retained-graphics delete-all sequence.
-
deleteRetainedGraphic(
int imageId, {int quiet = 2}) → String -
Returns the retained-graphics delete sequence for
imageId. -
enableWindowsVtInput(
) → void - No-op outside native Dart runtimes.
-
mayContainTerminalGraphics(
String value) → bool -
Whether
valuecan contain one of the graphics protocols handled here. -
newStyledString(
String str) → StyledString -
Factory function to create a StyledString from
str. -
parseTerminalGraphicsControls(
String value) → Iterable< TerminalGraphicsControl> -
Parses terminal graphics controls in
value. -
readLink(
String data, LinkState out) → void -
Parses an OSC 8 hyperlink sequence from
dataintoout. -
readStyle(
List< SgrParam> params, StyleState out) → void -
Parses SGR
paramsand applies them to the style inout. -
rect(
int x, int y, int width, int height) → Rectangle -
Creates a rectangle from origin (
x,y) and size (width,height). -
restoreWindowsVtInput(
) → void - No-op outside native Dart runtimes.
-
styledStringBounds(
String text, WidthMethod method) → Rectangle - Parses a string and returns its bounds (width/height) using a width method.
-
suppressOverflowingTerminalGraphics(
String text, int viewportHeight) → String -
Removes graphics displays that would paint outside
viewportHeight. -
terminalGraphicsCellWidth(
String line) → int -
Additional cell width contributed by graphics controls embedded in
line. -
terminalGraphicsControlCellWidth(
String controls) → int - Cell width for a pending control sequence group.
-
terminalGraphicsControlsDisplayImage(
String controls) → bool - Whether a pending control sequence group displays graphics.
-
terminalGraphicsSuppressesCursorMovement(
String value) → bool -
Whether
valuedisplays graphics while suppressing terminal cursor motion.