Table of Contents

CliAnsiWriter Class

Definition

Namespace
DotMake.CommandLine
Assembly
DotMake.CommandLine.dll

Represents an ANSI writer, capable of outputting ANSI/VT escape sequences.

public sealed class CliAnsiWriter
Inheritance
CliAnsiWriter

Constructors

CliAnsiWriter(TextWriter)

Initializes a new instance of the CliAnsiWriter class.

CliAnsiWriter(TextWriter, CliAnsiCapabilities)

Initializes a new instance of the CliAnsiWriter class.

Properties

Capabilities

Gets or sets the capabilities for the writer.

Methods

Background(CliColor)

Sets the current background color by emitting SGR.

BeginLink(CliLink)

Begins a link by emitting OSC 8.

BeginLink(string, int?)

Begins a link by emitting OSC 8.

ClearScrollback()

Clears the scrollback buffer by emitting CSI 3J.

CursorBackward(int)

This control function moves the cursor to the left by a specified number of columns by emitting CSI n D. The cursor stops at the left border of the page.

CursorBackwardTabulation(int)

Move the active position n tabs backward by emitting CSI n Z.

CursorDown(int)

This control function moves the cursor down a specified number of lines in the same column by emitting CSI n B. The cursor stops at the bottom margin. If the cursor is already below the bottom margin, then the cursor stops at the bottom line.

CursorForward(int)

This control function moves the cursor to the right by a specified number of columns by emitting CSI n C. The cursor stops at the right border of the page.

CursorHome()

Moves the cursor to position 1,1 (top left corner) by emitting CSI H.

CursorHorizontalAbsolute(int)

Moves the active position to the n-th character of the active line by emitting CSI n G

CursorHorizontalTabulation(int)

Move the active position n tabs forward by emitting CSI n I.

CursorLeft(int)

This control function moves the cursor to the left by a specified number of columns by emitting CSI n D. The cursor stops at the left border of the page.

CursorNextLine(int)

Move the cursor to the next line by emitting CSI n E.

CursorPosition(int, int)

This control function moves the cursor to the specified line and column (1-indexed) by emitting CSI row;column H.

CursorPreviousLine(int)

Move the cursor to the preceding line by emitting CSI n F.

CursorRight(int)

This control function moves the cursor to the right by a specified number of columns by emitting CSI n C. The cursor stops at the right border of the page.

CursorUp(int)

Moves the cursor up a specified number of lines in the same column by emitting CSI n A. The cursor stops at the top margin. If the cursor is already above the top margin, then the cursor stops at the top line.

Decoration(CliDecoration)

Sets the current decoration by emitting SGR.

DeleteCharacter(int)

This control function deletes one or more characters from the cursor position to the right by emitting CSI n P.

DeleteLine(int)

This control function deletes one or more lines in the scrolling region by emitting CSI n M, starting with the line that has the cursor. As lines are deleted, lines below the cursor and in the scrolling region move up. The terminal adds blank lines with no visual character attributes at the bottom of the scrolling region. If lines is greater than the number of lines remaining on the page, DL deletes only the remaining lines. DL has no effect outside the scrolling margins.

EndLink()

Ends a link by emitting OSC 8.

EnterAltScreen()

Enters the alternative screen buffer by emitting CSI ? 1049 h.

EraseCharacter(int)

Erases one or more characters from the cursor position to the right by emitting CSI n X (ECH). ECH clears character attributes from erased character positions. ECH works inside or outside the scrolling margins.

EraseInDisplay(int)

This control function erases characters from part or all of the display. When you erase complete lines, they become single-height, single-width lines, with all visual character attributes cleared. ED works inside or outside the scrolling margins.

EraseInLine(int)

This control function erases characters on the line that has the cursor. EL clears all character attributes from erased character positions. EL works inside or outside the scrolling margins.

ExitAltScreen()

Exits the alternative screen buffer by emitting CSI ? 1049 l.

Foreground(CliColor)

Sets the current foreground color by emitting SGR.

HideCursor()

Hides the cursor by emitting CSI ? 25 l.

Index()

Moves the cursor down one line in the same column by emitting ESC D. If the cursor is at the bottom margin, then the screen performs a scroll-up.

InsertCharacter(int)

inserts one or more space (SP) characters starting at the cursor position by emitting CSI n @ (ICH). The ICH sequence inserts blank characters with the normal character attribute. The cursor remains at the beginning of the blank characters. Text between the cursor and right margin moves to the right. Characters scrolled past the right margin are lost. ICH has no effect outside the scrolling margins.

InsertLine(int)

Inserts one or more blank lines, starting at the cursor by emitting CSI n L (IL). As lines are inserted, lines below the cursor and in the scrolling region move down. Lines scrolled off the page are lost. IL has no effect outside the page margins.

ResetStyle()

Resets any foreground, background, decoration, or style by emitting SGR(0).

RestoreCursor(bool)

Moves cursor to the position saved by save cursor command in SCO console mode by emitting CSI u (SCORC) if staying on page, otherwise ESC 8 (DECRC).

ReverseIndex()

Moves the cursor up one line in the same column by emitting ESC M. If the cursor is at the top margin, then the screen performs a scroll-down.

SaveCursor(bool)

Saves current cursor position for SCO console mode by emitting CSI s (SCOSC) if staying on page, otherwise ESC 7 (DECSC).

ScrollDown(int)

Moves the user window up a specified number of lines in page memory by emitting CSI n T.

ScrollUp(int)

Moves the user window down a specified number of lines in page memory by emitting CSI n S.

SetCursorStyle(int)

Select the style of the cursor on the screen by emitting CSI n SP q

ShowCursor()

Shows the cursor by emitting CSI ? 25 h.

Style(CliStyle, CliLink?)

Writes a Style(CliStyle, CliLink?) by emitting SGR.

Write(int)

Writes an integer.

Write(string)

Writes the specified text.

Write(string, CliStyle, CliLink?)

Writes the specified text with the specified style.

WriteLine()

Writes an empty line.

WriteLine(string)

Writes the specified text, followed by the current line terminator.

WriteLine(string, CliStyle, CliLink?)

Writes the specified text with the specified style, followed by the current line terminator.