Chooses between drawing a surface as pixels or as glyphs.
Modes are :text, :pixel, :kitty, :iterm2 and :sixel. :pixel means "whichever
protocol this terminal has"; the other three name one outright.
A mode is resolved most specific first:
- an override passed by the caller, when it is one of the modes
CAULDRON_MODEin the environment- the
:cauldron_2dapplication environment's:modekey :pixel
A resolved :pixel is then asked of FrenchCurve.Capability.detect/0. Its :braille
answer counts as no pixel protocol, and the text renderer takes over.
Summary
Functions
The resolved protocol's name, or "text", for a status bar.
Whether the surface is drawn as an image or as characters.
The mode names accepted as an override, in CAULDRON_MODE, or in application config.
The mode value names, or nil when it names none.
The pixel protocol to draw with, or nil for the text renderer.
Functions
The resolved protocol's name, or "text", for a status bar.
@spec mode(atom() | nil) :: :pixel | :text
Whether the surface is drawn as an image or as characters.
:pixel when protocol/1 finds one, :text otherwise. override is a mode name, or nil
to leave the choice to the environment and configuration.
@spec modes() :: [atom()]
The mode names accepted as an override, in CAULDRON_MODE, or in application config.
The mode value names, or nil when it names none.
Surrounding whitespace and case are ignored. nil in gives nil out.
@spec protocol(atom() | nil) :: :kitty | :iterm2 | :sixel | nil
The pixel protocol to draw with, or nil for the text renderer.
override is a mode name, or nil to leave the choice to the environment and
configuration. An override that is not one of modes/0 is ignored.