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.0.0+bb7ed9a8fdfd1cb21824750a8cf508863ad15086
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