Table of Contents

Method PrintAboveAsync

Namespace
Terminal.Gui.App
Assembly
Terminal.Gui.dll

PrintAboveAsync(IApplication, string, CancellationToken)

Queues text above the live inline region, using terminal default styling.

public static Task PrintAboveAsync(this IApplication app, string text, CancellationToken cancellationToken = default)

Parameters

app IApplication

Initialized inline application.

text string

Literal text. CRLF and CR become LF; one trailing LF terminates the last line.

cancellationToken CancellationToken

Cancels before insertion begins.

Returns

Task

A task completed after insertion, canceled before insertion, or faulted on failure.

Remarks

To print from a UI handler, await without blocking the event loop. Calls always queue in admission order. Empty text prints one blank line. Styled text uses the line overload. Raw ANSI controls are rejected. Content-sized inline views can shrink before insertion. Resize recovers the live origin without clearing printed text. Requires the ANSI driver in Inline mode; raster graphics and headless output are unsupported. Pending output ends with its session or disposal. After an uncertain I/O failure, stop the application; further inline placement is suppressed until a new initialized lifetime. Never blindly retry a failed insertion.

Exceptions

NotInitializedException

The application is not initialized or is stopping.

NotSupportedException

The application or output cannot support inline printing.

InvalidOperationException

The mode, geometry, or queue capacity is invalid.

ArgumentException

Text contains invalid Unicode or terminal controls.

PrintAboveAsync(IApplication, SessionToken, string, CancellationToken)

Queues literal text owned by a session.

public static Task PrintAboveAsync(this IApplication app, SessionToken owner, string text, CancellationToken cancellationToken = default)

Parameters

app IApplication

Initialized inline application.

owner SessionToken

Session that owns pending output; an ended or foreign session cancels it.

text string

Literal text with the same newline rules as the unowned overload.

cancellationToken CancellationToken

Cancels before insertion begins.

Returns

Task

The insertion task.

Remarks

To print from a UI handler, await without blocking the event loop. Calls always queue in admission order. Empty text prints one blank line. Styled text uses the line overload. Raw ANSI controls are rejected. Content-sized inline views can shrink before insertion. Resize recovers the live origin without clearing printed text. Requires the ANSI driver in Inline mode; raster graphics and headless output are unsupported. Pending output ends with its session or disposal. After an uncertain I/O failure, stop the application; further inline placement is suppressed until a new initialized lifetime. Never blindly retry a failed insertion.

PrintAboveAsync(IApplication, IReadOnlyList<InlineOutputLine>, CancellationToken)

Queues logical styled lines above the live inline region.

public static Task PrintAboveAsync(this IApplication app, IReadOnlyList<InlineOutputLine> lines, CancellationToken cancellationToken = default)

Parameters

app IApplication

Initialized inline application.

lines IReadOnlyList<InlineOutputLine>

Logical lines copied before admission; an empty list emits nothing.

cancellationToken CancellationToken

Cancels before insertion begins.

Returns

Task

The insertion task.

Remarks

To print from a UI handler, await without blocking the event loop. Calls always queue in admission order. Empty text prints one blank line. Styled text uses the line overload. Raw ANSI controls are rejected. Content-sized inline views can shrink before insertion. Resize recovers the live origin without clearing printed text. Requires the ANSI driver in Inline mode; raster graphics and headless output are unsupported. Pending output ends with its session or disposal. After an uncertain I/O failure, stop the application; further inline placement is suppressed until a new initialized lifetime. Never blindly retry a failed insertion.

PrintAboveAsync(IApplication, SessionToken, IReadOnlyList<InlineOutputLine>, CancellationToken)

Queues logical styled lines owned by a session.

public static Task PrintAboveAsync(this IApplication app, SessionToken owner, IReadOnlyList<InlineOutputLine> lines, CancellationToken cancellationToken = default)

Parameters

app IApplication

Initialized inline application.

owner SessionToken

Session that owns pending output.

lines IReadOnlyList<InlineOutputLine>

Logical lines copied before admission.

cancellationToken CancellationToken

Cancels before insertion begins.

Returns

Task

The insertion task.

Remarks

To print from a UI handler, await without blocking the event loop. Calls always queue in admission order. Empty text prints one blank line. Styled text uses the line overload. Raw ANSI controls are rejected. Content-sized inline views can shrink before insertion. Resize recovers the live origin without clearing printed text. Requires the ANSI driver in Inline mode; raster graphics and headless output are unsupported. Pending output ends with its session or disposal. After an uncertain I/O failure, stop the application; further inline placement is suppressed until a new initialized lifetime. Never blindly retry a failed insertion.