TermBuf::CapabilityResolver
Stability: internal
Settles what the terminal can do, in four stages, each overriding the one before it:
- a baseline of nothing at all;
- what the environment suggests;
- what the terminal says when asked directly;
- whatever
TERMBUF_CAPSinsists on.
Stage 3 is not quite unconditional: under a multiplexer a mode report can
be the multiplexer's own answer for a mode it never forwards, and those
modes are named by EnvironmentDetector.distrusted and handed to the
probe, which then adds nothing for them.
Probing is skipped when there is nothing to probe — output that is not a terminal, or a caller that did not supply one. That is not an error: the environment heuristics stand on their own, and a program writing to a pipe still needs a capability set.