Class TerminalEmulator
The terminal state machine: screen, cursor, attributes, modes, and responses. Feed host output through Feed; bytes the terminal sends back to the host (query responses) arrive on Output. All calls are expected on one thread. It is a VT100, VT52 mode included, with the VT102 and xterm additions programs rely on.
Assembly: DarkEffekt.Terminal.Core
Section titled “Assembly: DarkEffekt.Terminal.Core”public sealed class TerminalEmulatorProperties
Section titled “Properties”Screen
Section titled “Screen”public ScreenBuffer Screen { get; }MainScreen
Section titled “MainScreen”public ScreenBuffer MainScreen { get; }AltScreenActive
Section titled “AltScreenActive”public bool AltScreenActive { get; }public int Cols { get; }public int Rows { get; }CursorX
Section titled “CursorX”public int CursorX { get; }CursorY
Section titled “CursorY”public int CursorY { get; }CursorVisible
Section titled “CursorVisible”public bool CursorVisible { get; }CursorStyle
Section titled “CursorStyle”public CursorShape CursorStyle { get; }public string Title { get; }ApplicationCursorKeys
Section titled “ApplicationCursorKeys”public bool ApplicationCursorKeys { get; }ApplicationKeypad
Section titled “ApplicationKeypad”DECKPAM: the numeric keypad sends application codes.
public bool ApplicationKeypad { get; }Vt52Mode
Section titled “Vt52Mode”DECANM reset: the terminal takes VT52 escape sequences until ESC < returns it to ANSI.
public bool Vt52Mode { get; }NewLineMode
Section titled “NewLineMode”LNM: a line feed also returns the carriage, and Enter sends CR LF.
public bool NewLineMode { get; }LocalEcho
Section titled “LocalEcho”SRM reset: the host does not echo, so typed input is shown by the terminal itself.
public bool LocalEcho { get; }KeyboardLocked
Section titled “KeyboardLocked”KAM: the host has locked the keyboard; input is dropped until it unlocks it.
public bool KeyboardLocked { get; }ReverseVideo
Section titled “ReverseVideo”DECSCNM: the whole screen shows light on dark as dark on light.
public bool ReverseVideo { get; }KeyboardLeds
Section titled “KeyboardLeds”DECLL: the keyboard’s L1 to L4 lights, as bits 0 to 3.
public int KeyboardLeds { get; }Answerback
Section titled “Answerback”What ENQ is answered with. Empty answers nothing.
public string Answerback { get; set; }AllowColumnChange
Section titled “AllowColumnChange”Lets DECCOLM switch the terminal between 80 and 132 columns, as xterm’s mode 40 does. Off, the mode still clears the screen and homes the cursor, as on a VT100, but the width stays.
public bool AllowColumnChange { get; set; }BracketedPaste
Section titled “BracketedPaste”public bool BracketedPaste { get; }MouseTracking
Section titled “MouseTracking”public MouseTrackingMode MouseTracking { get; }MouseEncode
Section titled “MouseEncode”public MouseEncoding MouseEncode { get; }ChangeVersion
Section titled “ChangeVersion”Bumped on every visible change; renderers compare and redraw.
public int ChangeVersion { get; }KeyboardModes
Section titled “KeyboardModes”The keyboard modes the host has set, for an input encoder.
public KeyboardModes KeyboardModes { get; }Methods
Section titled “Methods”Feed(byte[], int, int)
Section titled “Feed(byte[], int, int)”public void Feed(byte[] data, int offset, int count)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Byte[] |
data |
System.Int32 |
offset |
System.Int32 |
count |
Feed(byte[])
Section titled “Feed(byte[])”public void Feed(byte[] data)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Byte[] |
data |
FeedText(string)
Section titled “FeedText(string)”public void FeedText(string text)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.String |
text |
Resize(int, int)
Section titled “Resize(int, int)”public void Resize(int cols, int rows)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Int32 |
cols |
System.Int32 |
rows |
FullReset()
Section titled “FullReset()”public void FullReset()GetText(CellRange)
Section titled “GetText(CellRange)”Reads the text a selection covers, for copy. Rows below 0 reach into scrollback.
public string GetText(CellRange range)Returns
Section titled “Returns”System.String
Parameters
Section titled “Parameters”| Type | Name |
|---|---|
| DarkEffekt.Terminal.CellRange | range |
GetText(int, int, int, int)
Section titled “GetText(int, int, int, int)”Reads a run of text from (x0, y0) through (x1, y1), inclusive. Rows below 0 reach into scrollback.
public string GetText(int x0, int y0, int x1, int y1)Returns
Section titled “Returns”System.String
Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Int32 |
x0 |
System.Int32 |
y0 |
System.Int32 |
x1 |
System.Int32 |
y1 |
Events
Section titled “Events”Output
Section titled “Output”Bytes the terminal sends to the host: query responses.
public event Action<byte[]> OutputEvent Type
Section titled “Event Type”System.Action<System.Byte[]>
Raised when the host rings the bell.
public event Action BellEvent Type
Section titled “Event Type”System.Action
TitleChanged
Section titled “TitleChanged”Raised when the host sets the window title through OSC 0 or 2.
public event Action<string> TitleChangedEvent Type
Section titled “Event Type”System.Action<System.String>
KeyboardLedsChanged
Section titled “KeyboardLedsChanged”Raised when the host changes the keyboard lights with DECLL.
public event Action<int> KeyboardLedsChangedEvent Type
Section titled “Event Type”System.Action<System.Int32>
ColumnsRequested
Section titled “ColumnsRequested”Raised when DECCOLM asks for 80 or 132 columns, before the terminal resizes itself if AllowColumnChange is on.
public event Action<int> ColumnsRequestedEvent Type
Section titled “Event Type”System.Action<System.Int32>