Defines the platform-specific backend used by Terminal and TerminalInstance.
[NullableContext((byte)1)]
public interface ITerminalBackend : IDisposable
Implementations should be thread-safe with respect to output serialization and should publish input events without blocking output.
kind:method, kind:property, kind:ctor. Press Esc to clear.Beep()Emits an audible beep (best effort).Clear(TerminalClearKind)Clears the terminal (best effort).EnableMouse(TerminalMouseMode)Enables mouse reporting within a scope (best effort).Flush()Flushes any buffered output (best effort).GetBufferSize()Gets the current buffer size in character cells.GetSize()Gets the current terminal size.ReadEventsAsync(CancellationToken)Reads terminal input events as an async stream.SetBackgroundColor(AnsiColor)Sets the background color (best effort).SetCursorPosition(TerminalPosition)Sets the cursor position (0-based).SetCursorVisible(Boolean)Sets the cursor visibility (best effort).SetTitle(String)Sets the terminal title (best effort).SetWindowSize(TerminalSize)Sets the window size (best effort).StartInput(TerminalInputOptions)Starts the input loop (idempotent).TryGetClipboardFormats(out IReadOnlyList<String>?)Tries to get the currently advertised clipboard formats (best effort).TryGetClipboardText(out String?)Tries to get the current clipboard text (best effort).TryReadEvent(out TerminalEvent)Tries to read a single event without awaiting.TrySetClipboardData(String, ReadOnlySpan<Byte>)Tries to set clipboard data for the specified format (best effort).UseAlternateScreen()Enables the alternate screen buffer within a scope (best effort).UseTitle(String)Sets the terminal title within a scope (best effort).