notcurses_capabilities(3)
πΈ NAME πΈ
notcurses_capabilities(3) β runtime capability detection. Okay so this is the page where Notcurses tells you what your terminal can actually do at runtime, bestie. It's giving "vibe check the terminal before you commit," and honestly? Iconic. π
β¨ SYNOPSIS β¨
#include <notcurses/notcurses.h>
const char* notcurses_detected_terminal(const struct notcurses* nc);
unsigned notcurses_supported_styles(const struct notcurses* nc);
unsigned notcurses_palette_size(const struct notcurses* nc);
bool notcurses_cantruecolor(const struct notcurses* nc);
bool notcurses_canfade(const struct notcurses* nc);
bool notcurses_canchangecolor(const struct notcurses* nc);
bool notcurses_canopen_images(const struct notcurses* nc);
bool notcurses_canopen_videos(const struct notcurses* nc);
bool notcurses_canutf8(const struct notcurses* nc);
bool notcurses_canhalfblock(const struct notcurses* nc);
bool notcurses_canquadrant(const struct notcurses* nc);
bool notcurses_cansextant(const struct notcurses* nc);
bool notcurses_canoctant(const struct notcurses* nc);
bool notcurses_canbraille(const struct notcurses* nc);
bool notcurses_canpixel(const struct notcurses* nc);
typedef enum {
NCPIXEL_NONE = 0,
NCPIXEL_SIXEL, // sixel
NCPIXEL_LINUXFB, // linux framebuffer
NCPIXEL_ITERM2, // iTerm2
NCPIXEL_KITTY_STATIC, // kitty pre-0.20.0
NCPIXEL_KITTY_ANIMATED, // kitty pre-0.22.0
NCPIXEL_KITTY_SELFREF, // kitty 0.22.0+, wezterm
} ncpixelimpl_e;
ncpixelimpl_e notcurses_check_pixel_support(struct notcurses* nc);
π¦ DESCRIPTION π¦
Okay so these are all little capability getters, and they're gonna tell you what's actually supported. No cap, this is the whole rundown:
notcurses_detected_terminalβ returns a free-form string describing the detected terminal. Terminal detection takes into account any specified terminal database (seenotcurses_init(3)), theTERM,TERM_PROGRAM, andTERM_PROGRAM_VERSIONenvironment variables, the response to aXTGETTCAP[TN]Device Control String, the response to Primary, Secondary, and Tertiary Send Device Attributes control sequences, and the phase of the moon. You should not build logic around this response; all relevant properties of the terminal ought be abstracted by Notcurses. This is only made available for diagnostics.notcurses_supported_stylesβ returns a bitmask representing those styles for which the terminal advertises support.notcurses_palette_sizeβ returns the size of the terminal's palette, used for palette-indexed color. It will always return at least 1. This is independent of RGB TrueColor support. No terminal is known to support more than 256-indexed color.notcurses_cantruecolorβ returns true if the terminal advertises support for RGB TrueColor. Note that the RGB APIs of Notcurses can be used even in the absence of terminal RGB support (Notcurses will map the RGB values to the palette).notcurses_canfadeβ returns true if Notcurses has a means by which it can effect fades.notcurses_canchangecolorβ returns true if the terminal advertises support for changing its palette entries.notcurses_canopen_imagesβ returns true if Notcurses was built with multimedia support.notcurses_canopen_videosβ returns true if Notcurses was built with multimedia support capable of decoding videos. (The DESCRIPTION text in this manpage spells this onenotcurses_canopen_video, singular; the SYNOPSIS hasnotcurses_canopen_videoswith thes.)notcurses_canutf8β returns true if the configured locale uses UTF-8 encoding, and the locale was successfully loaded.notcurses_canoctantβ returns true if the heuristics suggest that the terminal can properly render Unicode 16 octants.notcurses_cansextantβ returns true if the heuristics suggest that the terminal can properly render Unicode 13 sextants.notcurses_canquadrantβ returns true if the heuristics suggest that the terminal can properly render Unicode quadrants.notcurses_canhalfblockβ returns true if the heuristics suggest that the terminal can properly render Unicode halfblocks.notcurses_canbrailleβ returns true if Unicode Braille is expected to work on the terminal.- Shared note for the Unicode squad: none of these functions return true unless UTF-8 encoding is in use.
notcurses_check_pixel_supportβ returns a non-zero pixel implementation if bitmap support (via any mechanism) has been detected, and otherwise0(NCPIXEL_NONE).notcurses_canpixelβ foldsnotcurses_check_pixel_supportdown to a boolean.
π NOTES π
Heads up, bestie: some terminals advertise support for TrueColor, but then downsample or otherwise degrade the provided RGB. In this case notcurses_cantruecolor will return true, but the full spectrum will not be available. It's giving "promises were made," but the vibes are degraded. π
π SEE ALSO π
π AUTHORS π
nick black nickblack@linux.com
π That's the whole page, bestie β source/version: v3.0.17 from the footer of notcurses_capabilities(3). The footer didn't print a date on this copy, so no invented date, fr fr. π
π¦ where this page comes from
- alpine 3.24: notcurses-doc 3.0.17-r0 Β· Apache-2.0
- ubuntu resolute: libnotcurses-core-dev 3.0.17+dfsg-3 Β· Apache-2.0
- ubuntu stonking: libnotcurses-core-dev 3.0.17+dfsg-3 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms