Table of Contents

Class FakeConsoleOutput

Namespace
Terminal.Gui.Drivers
Assembly
Terminal.Gui.dll

Fake console output for testing that captures what would be written to the console.

public class FakeConsoleOutput : OutputBase, IConsoleOutput, IDisposable
Inheritance
FakeConsoleOutput
Implements
Inherited Members

Properties

Output

Gets the captured output as a string.

Methods

AppendOrWriteAttribute(StringBuilder, Attribute, TextStyle)

Changes the color and text style of the console to the given attr and redrawTextStyle. If command can be buffered in line with other output (e.g. CSI sequence) then it should be appended to output otherwise the relevant output state should be flushed directly (e.g. by calling relevant win 32 API method)

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

GetCursorPosition()

Gets the current cursor position.

GetSize()

Returns the current size of the console in rows/columns (i.e. of characters not pixels).

SetConsoleSize(int, int)

Sets the fake window size.

SetCursorPosition(int, int)

Moves the console cursor to the given location.

SetCursorPositionImpl(int, int)

When overriden in derived class, positions the terminal output cursor to the specified point on the screen.

SetCursorVisibility(CursorVisibility)

Changes the visibility of the cursor in the terminal to the specified visibility e.g. the flashing indicator, invisible, box indicator etc.

SetSize(int, int)

Sets the size of the console..

Write(ReadOnlySpan<char>)

Writes the given text directly to the console. Use to send ansi escape codes etc. Regular screen output should use the IOutputBuffer overload.

Write(StringBuilder)

Output the contents of the output to the console.