Detection runs once and produces a TerminalProfile: the output mode, the colour depth, the glyph tier, the window size, the theme preference and the culture. Every value carries the reason it was chosen, which Terminal.Profile.Decisions (and Get-ConsoleCapability in PowerShell) lists. The frames below are ConsoleMonster.Examples profile, run by the site tool in a Windows pseudo console.
Conhost 100x40 Interactive TrueColor Basic mode: Interactive (VT terminal) colour: TrueColor (Windows build >=14931) glyphs: Basic (conhost font 'Consolas') VT: supported kind: Conhost width profile: emoji=2, ambiguous=1, zwj=Joined, flag=2, text=1 (default) probe widths: True theme preference: Auto (CONSOLEMONSTER_THEME) culture: en-US (CONSOLEMONSTER_CULTURE) size: 100x40 (visible window or defaults)
What is detected
- Mode. Interactive on a VT console, Stream when output is redirected or a CI system is detected, Plain when asked for. Stream and Plain write lines instead of redrawing.
- Colour depth. 24-bit, 256, 16 or none.
NO_COLORturns colour off. - Glyph tier. Full, Basic or ASCII. On conhost the console font is read to choose; in stream and CI output the tier is Basic.
- Size. The visible window, not the screen buffer, so nothing is written past the window or into its bottom-right cell.
- Widths. Display widths come from Unicode 17 tables, with emoji and ambiguous widths that can be overridden. A width probe reads the console screen buffer and never reads input.
- Background. In conhost,
autoreads the console background colour to choose the light or dark theme. Windows Terminal does not expose its colour scheme to console programs, so thereCONSOLEMONSTER_THEME=lightselects the light theme.
Conhost 100x40 Stream None Basic mode: Stream (CI environment) colour: None (NO_COLOR) glyphs: Basic (stream/CI) VT: supported kind: Conhost width profile: emoji=2, ambiguous=1, zwj=Joined, flag=2, text=1 (default) probe widths: False theme preference: Dark (CONSOLEMONSTER_THEME) culture: en-US (CONSOLEMONSTER_CULTURE) size: 100x40 (visible window or defaults)
Overriding detection
Any decision can be pinned with an environment variable (see Environment overrides) or in code: TerminalProfile.Fixed(width, height, colors, glyphs) builds a profile without detection, and TerminalProfile.WithCulture, WithThemePreference and WithSize change one value. Terminal.Write(widget, profile) renders with it.
Conhost 100x40 Interactive TrueColor Full mode: Interactive (VT terminal) colour: TrueColor (CONSOLEMONSTER_COLOR) glyphs: Full (CONSOLEMONSTER_GLYPHS) VT: supported kind: Conhost width profile: emoji=2, ambiguous=1, zwj=Joined, flag=2, text=1 (default) probe widths: True theme preference: Dark (CONSOLEMONSTER_THEME) culture: en-US (CONSOLEMONSTER_CULTURE) size: 100x40 (visible window or defaults)
Fonts and resizing during a session
In conhost, the console font is polled about once a second; a new face or size re-derives the glyph tier and the emoji and ambiguous widths. In Windows Terminal, widths are measured again after every resize, which also covers zooming with Ctrl+= and Ctrl+0. Print-once output reads the window size on every write, so output printed after a resize uses the new width.