Method PrintAboveAsync
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
appIApplicationInitialized inline application.
textstringLiteral text. CRLF and CR become LF; one trailing LF terminates the last line.
cancellationTokenCancellationTokenCancels 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
appIApplicationInitialized inline application.
ownerSessionTokenSession that owns pending output; an ended or foreign session cancels it.
textstringLiteral text with the same newline rules as the unowned overload.
cancellationTokenCancellationTokenCancels 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
appIApplicationInitialized inline application.
linesIReadOnlyList<InlineOutputLine>Logical lines copied before admission; an empty list emits nothing.
cancellationTokenCancellationTokenCancels 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
appIApplicationInitialized inline application.
ownerSessionTokenSession that owns pending output.
linesIReadOnlyList<InlineOutputLine>Logical lines copied before admission.
cancellationTokenCancellationTokenCancels 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.