IAnsiConsole Interface

Represents a console.
public interface IAnsiConsole
Namespace
Spectre.Console
Implementing Types

Properties

abstract IAnsiConsoleCursor Cursor
Gets the console cursor.
abstract IExclusivityMode ExclusivityMode
Gets the exclusivity mode.
abstract IAnsiConsoleInput Input
Gets the console input.
abstract RenderPipeline Pipeline
Gets the render pipeline.
abstract Profile Profile
Gets the console profile.

Methods

abstract void Clear(bool)
Clears the console.
abstract void Write(IRenderable)
Writes a IRenderable to the console.

Extension Methods

void AlternateScreen(Action)
Switches to an alternate screen buffer if the terminal supports it.
T Ask<T>(string, CultureInfo)
Displays a prompt to the user.
T Ask<T>(string)
Displays a prompt to the user.
Task<T> AskAsync<T>(string, CancellationToken)
Displays a prompt to the user.
Task<T> AskAsync<T>(string, CultureInfo, CancellationToken)
Displays a prompt to the user.
void Clear()
Clears the console.
bool Confirm(string, bool)
Displays a prompt with two choices, yes or no.
Task<bool> ConfirmAsync(string, bool, CancellationToken)
Displays a prompt with two choices, yes or no.
Recorder CreateRecorder()
Creates a recorder for the specified console.
LiveDisplay Live(IRenderable)
Creates a new LiveDisplay instance for the console.
void Markup(IFormatProvider, string, object[])
Writes the specified markup to the console.
void Markup(string, object[])
Writes the specified markup to the console.
void Markup(string)
Writes the specified markup to the console.
void MarkupInterpolated(FormattableString)
Writes the specified markup to the console.

All interpolation holes which contain a string are automatically escaped so you must not call EscapeMarkup(string).

void MarkupInterpolated(IFormatProvider, FormattableString)
Writes the specified markup to the console.

All interpolation holes which contain a string are automatically escaped so you must not call EscapeMarkup(string).

void MarkupLine(IFormatProvider, string, object[])
Writes the specified markup, followed by the current line terminator, to the console.
void MarkupLine(string, object[])
Writes the specified markup, followed by the current line terminator, to the console.
void MarkupLine(string)
Writes the specified markup, followed by the current line terminator, to the console.
void MarkupLineInterpolated(FormattableString)
Writes the specified markup, followed by the current line terminator, to the console.

All interpolation holes which contain a string are automatically escaped so you must not call EscapeMarkup(string).

void MarkupLineInterpolated(IFormatProvider, FormattableString)
Writes the specified markup, followed by the current line terminator, to the console.

All interpolation holes which contain a string are automatically escaped so you must not call EscapeMarkup(string).

Progress Progress()
Creates a new Progress(IAnsiConsole) instance for the console.
T Prompt<T>(IPrompt<T>)
Displays a prompt to the user.
Task<T> PromptAsync<T>(IPrompt<T>, CancellationToken)
Displays a prompt to the user.
void Render(IRenderable)
Renders the specified object to the console.
T RunExclusive<T>(Func<T>)
Runs the specified function in exclusive mode.
Task<T> RunExclusive<T>(Func<Task<T>>)
Runs the specified function in exclusive mode asynchronously.
Status Status()
Creates a new Status(IAnsiConsole) instance for the console.
string ToAnsi(IRenderable)
Gets the VT/ANSI control code sequence for a IRenderable.
void Write(string, Style)
Writes the specified string value to the console.
void Write(string)
Writes the specified string value to the console.
void WriteAnsi(string)
Writes a VT/Ansi control code sequence to the console (if supported).
void WriteException(Exception, ExceptionFormats)
Writes an exception to the console.
void WriteException(Exception, ExceptionSettings)
Writes an exception to the console.
void WriteLine(string, Style)
Writes the specified string value, followed by the current line terminator, to the console.
void WriteLine(string)
Writes the specified string value, followed by the current line terminator, to the console.
void WriteLine()
Writes an empty line to the console.