Skip to content
ConsoleMonster

Capability detection

ConsoleMonster detects VT support, colour depth, the glyphs the font can draw, size, redirection, CI and the background, and records why.

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.

ConsoleMonster.Examples profile 100 columns
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)
Nothing overridden: VT is available, the Windows build supports 24-bit colour, and the console font (Consolas) has no braille, so the glyph tier is Basic.

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_COLOR turns 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, auto reads the console background colour to choose the light or dark theme. Windows Terminal does not expose its colour scheme to console programs, so there CONSOLEMONSTER_THEME=light selects the light theme.
ConsoleMonster.Examples profile 100 columns
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)
With CI=true and NO_COLOR=1: stream mode, no colour, Basic glyphs and no width probing.

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.

ConsoleMonster.Examples profile 100 columns
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)
The profile the site uses for its captures: CONSOLEMONSTER_COLOR, _GLYPHS, _THEME and _CULTURE pinned.

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.

Edit this page on GitHub