Skip to content
ConsoleMonster
Class

TerminalHandoff

ConsoleMonster.Interactive

Namespace
ConsoleMonster.Interactive
Assembly
ConsoleMonster
Modifiers
sealed

Hands a running app's terminal to an owned child PTY and restores its screen, raw input and focus afterwards. No recording or input history is written.

Inheritance

  • object
  • TerminalHandoff

Usage

Explore 9 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 6

Constructors

public TerminalHandoff() #

Methods

public void ShowOutput(CancellationToken cancellationToken = default) #

Shows the last child's terminal screen until any key is pressed. Resizes redraw the output; focus and app modes are retained.

Parameters

cancellationToken System.Threading.CancellationToken = default optional
public int SuspendForChild(TerminalChildOptions options, CancellationToken cancellationToken = default) #

Runs a child on a real terminal. Call on the owning app thread from its registry or callback. Nonzero exit codes are returned; startup and transport errors escape after restoration.

Parameters

options ConsoleMonster.Interactive.TerminalChildOptions required
cancellationToken System.Threading.CancellationToken = default optional

Returns

int

Properties

public int OutputCapacity { get; set; } #

Maximum retained output characters. Old output is dropped from the front; no child input is retained.

public string LastOutput { get; } #

The last child's bounded terminal output, including its colours and terminal sequences.

public bool Running { get; } #

Whether a child currently owns the terminal.

Extension Methods

public static TerminalHandoff OutputCapacity(TerminalHandoff terminalHandoff, int value) #

Sets TerminalHandoff.OutputCapacity: Maximum retained output characters. Old output is dropped from the front; no child input is retained.

Parameters

terminalHandoff ConsoleMonster.Interactive.TerminalHandoff required
The instance.
value int required
The value.

Returns

TerminalHandoff The same instance.

Examples

// C# initializer or property                                                         // C# fluent
new global::ConsoleMonster.Interactive.TerminalHandoff { OutputCapacity = value };    terminalHandoff.OutputCapacity(value);