Class TerminalCapabilities
- Namespace
- SharpConsoleUI.Helpers
- Assembly
- SharpConsoleUI.dll
Detects terminal rendering capabilities at runtime. Probed once during driver initialization; results are cached for the session.
public static class TerminalCapabilities
- Inheritance
-
TerminalCapabilities
- Inherited Members
Properties
SupportsUnicode16Widths
Whether the terminal renders Unicode 16.0 newly-widened characters (e.g. U+2630 ☰ trigrams) as 2 columns. When false, these characters are treated as width 1 (Unicode 15.0 behavior). Defaults to false (most terminals haven't adopted Unicode 16.0 widths yet).
public static bool SupportsUnicode16Widths { get; }
Property Value
SupportsVS16Widening
Whether the terminal renders emoji+VS16 (U+FE0F) as 2 columns. When false, VS16 is ignored by the terminal and emoji stay width 1. Defaults to true (modern terminal assumption) until probed.
public static bool SupportsVS16Widening { get; }
Property Value
Methods
Probe(Action<string>, Func<int>)
Probes the terminal to determine rendering capabilities. Tests VS16 emoji widening and Unicode 16.0 width changes. Must be called after raw mode is entered and before input loops start.
public static void Probe(Action<string> write, Func<int> readByte)
Parameters
writeAction<string>Action to write escape sequences to the terminal.
readByteFunc<int>Function to read a single byte from stdin with timeout. Returns -1 on timeout or error.
SetUnicode16Widths(bool)
Allows manual override of the Unicode 16.0 width capability. Useful for testing or when the terminal is known ahead of time.
public static void SetUnicode16Widths(bool supported)
Parameters
supportedbool
SetVS16Widening(bool)
Allows manual override of the VS16 widening capability. Useful for testing or when the terminal is known ahead of time.
public static void SetVS16Widening(bool supported)
Parameters
supportedbool