Table of Contents

Class ExecuteOptions

Namespace
Tmds.Ssh
Assembly
Tmds.Ssh.dll

Options for executing commands.

public sealed class ExecuteOptions
Inheritance
ExecuteOptions
Inherited Members

Properties

AllocateTerminal

Gets or sets whether to allocate a pseudo-terminal.

public bool AllocateTerminal { get; set; }

Property Value

bool

Remarks

Defaults to false.

EnvironmentVariables

Gets or sets environment variables for the remote process.

public Dictionary<string, string> EnvironmentVariables { get; set; }

Property Value

Dictionary<string, string>

Remarks

Often SSH servers don't accept environment variables (for security).

When AllocateTerminal is set to true, 'TERM' is ignored when its value does not match TerminalType.

ForwardAgent

Gets or sets whether to request agent forwarding.

public ForwardMode? ForwardAgent { get; set; }

Property Value

ForwardMode?

Remarks

When null (the default), ForwardAgent is used.

When set to Request, agent forwarding setup failures are logged and the remote process is started without agent forwarding. When set to Require, the operation fails if setup fails or the server refuses agent forwarding.

The agent to forward is configured using ForwardAgentAddress.

ForwardX11

Gets or sets whether to request X11 forwarding.

public ForwardMode? ForwardX11 { get; set; }

Property Value

ForwardMode?

Remarks

When null (the default), ForwardX11 is used.

When set to Request, X11 setup failures are logged and the remote process is started without X11 forwarding. When set to Require, X11 setup failures fail the operation.

The forwarded display and authentication are configured using X11Display, ForwardX11Trusted, ForwardX11Timeout, and XAuthLocation.

StandardErrorEncoding

Gets or sets the Encoding for standard error.

public Encoding StandardErrorEncoding { get; set; }

Property Value

Encoding

StandardInputEncoding

Gets or sets the Encoding for standard input.

public Encoding StandardInputEncoding { get; set; }

Property Value

Encoding

StandardOutputEncoding

Gets or sets the Encoding for standard output.

public Encoding StandardOutputEncoding { get; set; }

Property Value

Encoding

TerminalSettings

Configure additional terminal settings.

public TerminalSettings TerminalSettings { get; }

Property Value

TerminalSettings

TerminalSize

Gets or sets the size of the terminal.

public TerminalSize TerminalSize { get; set; }

Property Value

TerminalSize

Remarks

Defaults to 80 columns by 24 rows, without a pixel size.

TerminalType

Gets or sets the terminal type.

public string TerminalType { get; set; }

Property Value

string

Remarks

Defaults to "xterm-256color".

WindowSize

Gets or sets the SSH channel window size in bytes.

public int? WindowSize { get; set; }

Property Value

int?

Remarks

When null (the default), DefaultWindowSize is used.

The window size controls the maximum amount of data that can be sent by the remote end before it must wait for acknowledgement. Larger values can improve throughput on high-latency or high-bandwidth links at the cost of higher memory usage per channel.