VirtualTerminalEnableColor Method

Enables color support using 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 EnableColor(
	StandardStream stream
)

Parameters

stream  StandardStream
The StandardStream to enable color sequences for.

Return Value

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

Remarks

If an environment variable named "NO_COLOR" exists, this function will not enable VT sequences. Otherwise, this function calls the EnableVirtualTerminalSequences(StandardStream) method and returns its result.

See Also