Table of Contents

Class TerminalStartContext

Namespace
OneImlx.Terminal.Runtime
Assembly
OneImlx.Terminal.dll

The terminal start context.

public sealed class TerminalStartContext
Inheritance
TerminalStartContext
Inherited Members

Remarks

The TerminalStartContext represents the context for starting a terminal session, including start mode, cancellation tokens, custom properties, and driver or command line arguments. It encapsulates all necessary information to initiate and control a terminal session, providing flexibility through custom properties and robust control via cancellation tokens.

Constructors

TerminalStartContext(TerminalStartMode, CancellationToken, CancellationToken, Dictionary<string, object>?, string[]?)

Initialize a new instance.

public TerminalStartContext(TerminalStartMode terminalStartMode, CancellationToken terminalCancellationToken, CancellationToken commandCancellationToken, Dictionary<string, object>? customProperties = null, string[]? driverArguments = null)

Parameters

terminalStartMode TerminalStartMode

The terminal start mode.

terminalCancellationToken CancellationToken

The terminal routing cancellation token.

commandCancellationToken CancellationToken

The command routing cancellation token.

customProperties Dictionary<string, object>

The custom properties.

driverArguments string[]

The driver arguments or command line start arguments.

Properties

Arguments

The terminal driver arguments or command line arguments.

public string[]? Arguments { get; }

Property Value

string[]

Remarks

These arguments are the command line inputs provided at the application's main entry point when starting a terminal session via a driver or via Process. This allows for dynamic and flexible terminal session configuration, adapting to different operational parameters and user-defined settings. It's particularly useful for modifying startup behaviors and handling various runtime environments, ensuring the terminal adapts to specific needs and contexts.

CommandCancellationToken

The cancellation token to cancel the current command routing.

public CancellationToken CommandCancellationToken { get; }

Property Value

CancellationToken

Remarks

This cancellation token is used for granular control over individual long-running commands. When triggered, it cancels only the currently executing command without affecting the overall terminal routing. This allows for selective interruption of commands, which is useful in scenarios where a specific operation needs to be stopped due to changes in user input or application state, while allowing the terminal to continue routing new commands.

CustomProperties

The custom properties.

public Dictionary<string, object>? CustomProperties { get; }

Property Value

Dictionary<string, object>

Remarks

A collection of key-value pairs that can be used to pass additional information or configuration settings to the terminal session. These properties offer a way to extend the functionality and behavior of the terminal without modifying the core implementation.

StartMode

The terminal start mode.

public TerminalStartMode StartMode { get; }

Property Value

TerminalStartMode

TerminalCancellationToken

The cancellation token to cancel the global terminal routing.

public CancellationToken TerminalCancellationToken { get; }

Property Value

CancellationToken

Remarks

This cancellation token is used for global control over the entire terminal routing. When triggered, it cancels the entire terminal routing, effectively stopping the routing any further commands. This is particularly useful in scenarios where a complete shutdown of the terminal's operational context is required, such as during application termination or critical error handling.