Skip to content

RestoreCursorToken ​

Namespace: Hex1b.Tokens

Assembly: Hex1b.dll

Represents a cursor restore command: ESC 8 (DECRC) or ESC [ u (ANSI.SYS)

csharp
public sealed record RestoreCursorToken : AnsiToken, IEquatable<AnsiToken>, IEquatable<RestoreCursorToken>

Inheritance ​

Object → AnsiToken → RestoreCursorToken

Implements ​

Constructors ​

RestoreCursorToken(bool) ​

Represents a cursor restore command: ESC 8 (DECRC) or ESC [ u (ANSI.SYS)

Parameters:

  • UseDec (Boolean): If true, use DEC format (ESC 8) which also restores character attributes. If false, use ANSI.SYS format (ESC [ u) which only restores cursor position.
csharp
public RestoreCursorToken(bool UseDec = true)

Properties ​

UseDec ​

If true, use DEC format (ESC 8) which also restores character attributes. If false, use ANSI.SYS format (ESC [ u) which only restores cursor position.

Returns: Boolean

csharp
public bool UseDec { get; init; }

Fields ​

Ansi ​

Restore cursor using ANSI.SYS format (ESC [ u) - restores position only.

Returns: RestoreCursorToken

csharp
public static readonly RestoreCursorToken Ansi

Dec ​

Restore cursor using DEC format (ESC 8) - restores position and attributes.

Returns: RestoreCursorToken

csharp
public static readonly RestoreCursorToken Dec

Remarks ​

Restores the cursor position (and optionally attributes) previously saved with .

Should be paired with the matching save format - DEC save with DEC restore, ANSI.SYS save with ANSI.SYS restore.

Released under the MIT License.