VirtualTerminalEnableVirtualTerminalSequences Method

Enables virtual terminal sequences for the console attached to the specified stream.

Definition

Namespace: Ookii.CommandLine.Terminal
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.2.0+a4d3631e4dcc0970081ed435288efdebc1325f83
C#
public static VirtualTerminalSupport EnableVirtualTerminalSequences(
	StandardStream stream
)

Parameters

stream  StandardStream
The StandardStream to enable VT sequences for.

Return Value

VirtualTerminalSupport
An instance of the VirtualTerminalSupport class that will disable virtual terminal support when disposed or finalized. Use the VirtualTerminalSupportIsSupported property to check if virtual terminal sequences are supported.

Remarks

Virtual terminal sequences are supported if the specified stream is not redirected, and the TERM environment variable is not set to "dumb". On Windows, enabling VT support has to succeed. On non-Windows platforms, VT support is assumed if the TERM environment variable is defined.

If you also want to check for a NO_COLOR environment variable, use the EnableColor(StandardStream) method instead.

For StandardStreamInput, this method does nothing and always returns .

See Also