TermBuf::Capabilities
Stability: stable — changes only in a major release.
A capability mask that keeps itself consistent.
Support is capped, not limited: a terminal that can do 24 bit colour can also do the 256 colour palette and the original sixteen, so setting the broader capability implies the narrower ones. The encoder relies on that, and checks only the capability it is about to use.
Constants
What essentially every terminal emulator written since the 1980s does.
A current terminal such as kitty, ghostty, or WezTerm.
No RapidBlink. SGR 6 is one of the least implemented codes there is —
kitty draws nothing at all for it, where SGR 5 blinks — and this shard
assumes a capability absent without a reason to believe otherwise. The
encoder steps a rapid blink down to an ordinary one rather than dropping
it, so asking for it still blinks; a terminal measured doing better can
be given the flag by name.
No Osc52Clipboard or GraphemeClusters either, for the reasons given
on those two: both are detected, neither is presumed from a terminal
being modern.
FocusEvents, MouseSgr, Titles and CursorShape were the four here
that nothing had ever watched: each reached a terminal by way of a table
of names, and a name is a statement about a family. All four were watched
working on 2026-09-10, on ghostty 1.3.2, kitty 0.48.2 and iTerm2 3.6.11 —
a focus report on the way out and back in, a click reported, the window
renamed, the cursor's shape changed — so all four stay. What the same
readings did change is where a multiplexer or Terminal.app is concerned;
see measurements/CAPS.md and EnvironmentDetector.
Nothing at all: plain text, no escape sequences. The starting point for detection, and what an unrecognised terminal gets.
A typical xterm-256color terminal.
Constructors
A mask carrying flags and everything they imply. See .normalize, and
NONE, ANSI, XTERM and MODERN for the presets.
Class methods
Applies the implications a capability carries with it.
Instance methods
Adds a capability along with everything it implies, so that setting
TrueColor also sets Color256 and Color16.
Removes a capability along with everything that implies it, so that
clearing Color256 also clears TrueColor rather than leaving a mask
that claims both.