API Reference
TerminalWidthProbe
Measures how wide the current interactive terminal draws emoji, ZWJ sequences, flags, CJK and East Asian Ambiguous characters, by writing a small sample set and reading the cursor column back from the console screen buffer. A live session runs it once per process on the alternate screen, before its first frame, so the samples are never visible in scrollback. It never reads console input: the cursor position comes from GetConsoleScreenBufferInfo, which inside Windows Terminal (ConPTY) reports the same advances as the terminal's own cursor report.
Inheritance
- Object
- TerminalWidthProbe
Methods
public static Void Invalidate() #VoidForgets the cached measurement so the next call to TerminalWidthProbe.TryProbe measures again.
public static Boolean TryProbe(ITerminalWriter writer, TimeSpan timeout, out TerminalWidthProfile profile, out String decision) #BooleanProbes once per process through writer (the console writer the session draws with); later calls return the cached outcome. Call it only while the alternate screen is active: the probe writes on the current row and erases it afterwards.
Parameters
- writer ConsoleMonster.Output.ITerminalWriter
- The console writer; it must write UTF-16 to the console (not a code-page stream).
- timeout System.TimeSpan
- Overall time budget for the samples (about 300 ms is typical; measuring usually takes a few).
- profile ConsoleMonster.Text.TerminalWidthProfile
- The measured profile, or TerminalWidthProfile.Standard when probing failed.
- decision System.String
- A human-readable result or skip reason.
Returns
True when the sample set was measured.
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?