Skip to content
ConsoleMonster

Environment overrides

NO_COLOR and the CONSOLEMONSTER_* variables pin what detection would otherwise decide, for CI, tests, screenshots and accessibility.

Variables are read when the profile is detected. An invalid value is ignored and noted in the profile's decisions, so Get-ConsoleCapability shows why it had no effect.

VariableValuesEffect
NO_COLORany valueNo colour anywhere, including host output in PowerShell. Status symbols stay.
CONSOLEMONSTER_COLORnone, 16, 256, truecolor or 24bitThe colour depth.
CONSOLEMONSTER_GLYPHSfull, basic, asciiThe glyph tier: box drawing, block and braille characters, status symbols and spinners.
CONSOLEMONSTER_MODEinteractive (or live), stream, plainInteractive redraws in place; stream writes append-only lines; plain writes ASCII lines without colour or escape sequences.
CONSOLEMONSTER_THEMEdark, light, autoThe theme preference. auto reads the background in conhost.
CONSOLEMONSTER_CULTUREa culture name, invariant or currentNumbers and dates in tables and presenters. An unknown name is ignored.
CONSOLEMONSTER_LANGUAGEa language name such as de or plThe language of built-in labels, separately from the number culture. German, Spanish, French and Italian are built in; others fall back to English.
CONSOLEMONSTER_EMOJI_WIDTH1, 2 or autoThe width of emoji, for consoles that draw them narrow.
CONSOLEMONSTER_AMBIGUOUS_WIDTH1, 2 or autoThe width of East Asian ambiguous characters.
CONSOLEMONSTER_NONINTERACTIVE1Prompts return their default or fail with a message that names the parameter to pass.
CONSOLEMONSTER_ACCESSIBLE1Prompts ask plain numbered questions with no redraws, and every answer is confirmed as text.
CONSOLEMONSTER_UPDATE_GOLDEN1GoldenFile rewrites golden files instead of comparing.

Detection also reads CI and the variables of common CI systems (GitHub Actions, Azure Pipelines, Jenkins, GitLab, TeamCity), TERM (dumb selects plain mode), COLORTERM and WT_SESSION.

The same table under overrides

The script is the PowerShell page's Format-ConsoleTable example; only the environment changes.

format-consoletable.ps1 PowerShell 7.6
 PSPublishModule artifacts
╭─────────────────────────────┬─────────┬──────────┬────────┬──────────────────────────────────────╮
│ Name                        │    Size │ Built in │ Signed │ Path                                 │
├─────────────────────────────┼─────────┼──────────┼────────┼──────────────────────────────────────┤
│ NuGet  2                                                                                         │
│ ConsoleMonster.2.0.0.nupkg  │ 1.41 MB │     48 s │ ✓ yes  │ C:\Support\GitHub\…nster.2.0.0.nupkg │
│ ConsoleMonster.2.0.0.snupkg │  393 KB │    3.1 s │ ✓ yes  │ C:\Support\GitHub\…ster.2.0.0.snupkg │
│ Subtotal                    │  1.8 MB │     51 s │        │                                      │
│ Module  2                                                                                        │
│ ConsoleMonster-2.0.0.zip    │ 2.77 MB │     12 s │ ✓ yes  │ C:\Support\GitHub\…Monster-2.0.0.zip │
│ Docs.zip                    │ 50.1 KB │    1.2 s │ – no   │ C:\Support\GitHub\…s\Packed\Docs.zip │
│ Subtotal                    │ 2.82 MB │     13 s │        │                                      │
├─────────────────────────────┼─────────┼──────────┼────────┼──────────────────────────────────────┤
│ Total                       │ 4.62 MB │ 1 m 04 s │        │                                      │
╰─────────────────────────────┴─────────┴──────────┴────────┴──────────────────────────────────────╯
format-consoletable.ps1 PowerShell 7.6
 PSPublishModule artifacts
+-----------------------------+---------+----------+--------+--------------------------------------+
| Name                        |    Size | Built in | Signed | Path                                 |
+-----------------------------+---------+----------+--------+--------------------------------------+
| NuGet  2                                                                                         |
| ConsoleMonster.2.0.0.nupkg  | 1.41 MB |     48 s | yes    | C:\Support\GitHub...ster.2.0.0.nupkg |
| ConsoleMonster.2.0.0.snupkg |  393 KB |    3.1 s | yes    | C:\Support\GitHub...ter.2.0.0.snupkg |
| Subtotal                    |  1.8 MB |     51 s |        |                                      |
| Module  2                                                                                        |
| ConsoleMonster-2.0.0.zip    | 2.77 MB |     12 s | yes    | C:\Support\GitHub...onster-2.0.0.zip |
| Docs.zip                    | 50.1 KB |    1.2 s | no     | C:\Support\GitHub...\Packed\Docs.zip |
| Subtotal                    | 2.82 MB |     13 s |        |                                      |
+-----------------------------+---------+----------+--------+--------------------------------------+
| Total                       | 4.62 MB | 1 m 04 s |        |                                      |
+-----------------------------+---------+----------+--------+--------------------------------------+
NO_COLOR=1 keeps the layout and the status words; CONSOLEMONSTER_MODE=plain also switches to ASCII.

In code

The same choices are available without the environment: TerminalProfile.Fixed(width, height, colors, glyphs) for a profile with no detection, and WithCulture, WithThemePreference, WithSize, WithColorDepth and WithMode to change one value. Live sessions take LiveSessionOptions.Profile, Theme and Culture.

Edit this page on GitHub