Users and CI expect no-color.org semantics for accessibility and logs.
Design model
Platform spec article
Design model
Spec standingStandard
-
Any non-empty NO_COLOR strips ANSI emission.
Context
Decision
Rule Detail NO_COLORNon-empty value must force ShouldEmitAnsi()falseReference no-color.org Consequences
Capability probes and markup render paths consult the same gate.
Verification anchors
CapabilitiesTests.bd;Console/Capabilities.bd. -
COLORTERM presence selects TrueColor when color allowed.
Context
Modern terminals advertise truecolor via COLORTERM without breaking NO_COLOR.
Decision
Rule Detail Probe COLORTERMset →TrueColorwhen color not strippedFORCE_COLORMay enable emission on non-TTY stdout Consequences
EffectiveColorModel reflects env probes before SGR downgrade (see D-CORE-TERM-0003).
Verification anchors
CapabilitiesTests.bd. -
RGB downgrades through palette ladders automatically.
Context
Callers should not manually pick CSI color modes per terminal.
Decision
Rule Detail Downgrade RGB → indexed → basic is lossy API No per-sequence model selector on public helpers Consequences
Styled output remains readable on Basic16 hosts without author branches.
Verification anchors
AnsiSgrGoldenTests.bd; capability + SGR integration.
- Contracts and edge cases MUST rules for capability probing and color stripping.
- Design model Capability record, color models, and environment-driven probing.
- Examples Checking capabilities before custom styling.
- Flow and algorithm Probe and strip algorithms for terminal capabilities.
- Verification and traceability Tests and sources for capability probing.
0 revisions (git unavailable at build; counts may be empty)
No commits recorded for this path.
| Section id | Required | Found |
|---|---|---|
what-this-feature-specifies | yes | yes |
implementation-anchors | yes | yes |
Full tree: run pnpm verify:platform-spec-layout (writes src/generated/platform-spec-layout-report.json).
Purpose
Section titled “Purpose”Document design model for the Console Capabilities feature: role-specific normative detail beyond the feature hub.
Canonical references
Section titled “Canonical references”- Feature hub: Console Capabilities
- Sibling articles in this bundle (design model, contracts, flow, examples, verification)
Detailed behavior
Section titled “Detailed behavior”Capabilities record
Section titled “Capabilities record”| Field | Meaning |
|---|---|
isTty | stdout (fd 1) is a terminal |
colorDisabled | NO_COLOR set |
colorForced | FORCE_COLOR set |
model | Probed ColorModel before strip |
ProbeStdout() composes the record from Platform.Terminal.IsAtty(1) and environment helpers.
ColorModel ladder
Section titled “ColorModel ladder”| Variant | Typical trigger |
|---|---|
Basic8 | Reserved for minimal terminals |
Basic16 | Default when stripped or TERM=xterm-color |
Indexed256 | TERM=xterm-256color or generic TERM set |
TrueColor | COLORTERM set (e.g. truecolor) |
Ansi.Sgr maps requested RGB to the effective model after ShouldStripColor.
Interaction with ANSI emission
Section titled “Interaction with ANSI emission”ShouldEmitAnsi() is equivalent to !ShouldStripColor(ProbeStdout()). All gated escape helpers consult this predicate; see ANSI escape model / flow and algorithm.
Verification
Section titled “Verification”See the verification and traceability article in this bundle and compiler/corelib/beskid_corelib/tests/corelib_tests/src/console/.
Related topics
Section titled “Related topics”- Parent feature hub and Terminal and console area