ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
terminal_capabilities_t Struct Reference

Complete terminal capabilities structure. More...

#include <include/ascii-chat/platform/terminal.h>

Data Fields

terminal_color_mode_t color_level
 Detected color support level (terminal_color_mode_t)
 
uint32_t capabilities
 Capability flags bitmask (terminal_capability_flags_t)
 
uint32_t color_count
 Maximum number of colors (2, 16, 256, or 16777216)
 
bool utf8_support
 True if terminal supports UTF-8 encoding.
 
bool detection_reliable
 True if detection is confident (reliable detection)
 
render_mode_t render_mode
 Preferred rendering mode (render_mode_t)
 
char term_type [64]
 $TERM environment variable value (for debugging)
 
char colorterm [64]
 $COLORTERM environment variable value (for debugging)
 
bool wants_background
 True if background colors are preferred.
 
int palette_type
 Palette type enum value (palette_type_t)
 
char palette_custom [64]
 Custom palette characters (if palette_type == PALETTE_CUSTOM)
 
uint8_t desired_fps
 Client's desired frame rate (1-144 FPS)
 
color_filter_t color_filter
 Monochromatic color filter enum value (color_filter_t)
 
bool wants_padding
 Whether client wants frame padding (centering) - false for snapshot/piped modes.
 
size_t pad_height
 Number of top padding lines when wants_padding is true.
 

Detailed Description

Complete terminal capabilities structure.

Comprehensive terminal capabilities structure containing all detected terminal features, color support, encoding capabilities, and rendering preferences. Used for optimal ASCII art rendering configuration.

This structure is populated by detect_terminal_capabilities() and contains all information needed to make rendering decisions. The structure balances automatic detection with user overrides and sensible defaults.

Detection reliability: The detection_reliable field indicates confidence in detected capabilities. If unreliable, the terminal capabilities may be guessed or defaulted rather than definitively detected. In such cases, users can override with command-line flags (–color, –256, –truecolor) for more accurate results.

Color and rendering:

  • color_level: Auto-detected or user-overridden via –color-mode
  • render_mode: Determines how ASCII art is rendered (foreground vs background)
  • wants_background: Whether to prefer background colors over foreground
  • color_filter: Optional monochromatic filter for accessibility/visibility

Encoding and internationalization:

  • utf8_support: Determines whether Unicode characters can be used
  • Required for palette characters that use Unicode blocks/symbols

User preferences:

  • desired_fps: Client's requested frame rate (1-144 FPS)
  • wants_padding: Whether to center video in terminal (false when piped/snapshot)
  • palette_type: Selected character palette (ASCII, Unicode blocks, custom)

Debugging information:

  • term_type: Value of $TERM environment variable (for troubleshooting)
  • colorterm: Value of $COLORTERM (RGB/256/none hints)

Definition at line 709 of file terminal.h.

Field Documentation

◆ capabilities

uint32_t terminal_capabilities_t::capabilities

◆ color_count

uint32_t terminal_capabilities_t::color_count

◆ color_filter

color_filter_t terminal_capabilities_t::color_filter

Monochromatic color filter enum value (color_filter_t)

Definition at line 735 of file terminal.h.

Referenced by ascii_convert_with_capabilities(), detect_terminal_capabilities(), handle_client_capabilities_packet(), and mirror_convert_frame().

◆ color_level

◆ colorterm

char terminal_capabilities_t::colorterm[64]

$COLORTERM environment variable value (for debugging)

Definition at line 725 of file terminal.h.

Referenced by action_show_capabilities_immediate(), detect_terminal_capabilities(), handle_client_capabilities_packet(), and threaded_send_terminal_size_with_auto_detect().

◆ desired_fps

uint8_t terminal_capabilities_t::desired_fps

◆ detection_reliable

bool terminal_capabilities_t::detection_reliable

◆ pad_height

size_t terminal_capabilities_t::pad_height

Number of top padding lines when wants_padding is true.

Definition at line 739 of file terminal.h.

Referenced by session_display_create().

◆ palette_custom

char terminal_capabilities_t::palette_custom[64]

Custom palette characters (if palette_type == PALETTE_CUSTOM)

Definition at line 731 of file terminal.h.

Referenced by handle_client_capabilities_packet().

◆ palette_type

int terminal_capabilities_t::palette_type

Palette type enum value (palette_type_t)

Definition at line 729 of file terminal.h.

Referenced by detect_terminal_capabilities(), handle_client_capabilities_packet(), and mirror_convert_frame().

◆ render_mode

◆ term_type

char terminal_capabilities_t::term_type[64]

◆ utf8_support

bool terminal_capabilities_t::utf8_support

◆ wants_background

bool terminal_capabilities_t::wants_background

True if background colors are preferred.

Definition at line 727 of file terminal.h.

Referenced by detect_terminal_capabilities(), handle_client_capabilities_packet(), and mirror_convert_frame().

◆ wants_padding

bool terminal_capabilities_t::wants_padding

Whether client wants frame padding (centering) - false for snapshot/piped modes.

Definition at line 737 of file terminal.h.

Referenced by handle_client_capabilities_packet(), mirror_convert_frame(), session_display_create(), and threaded_send_terminal_size_with_auto_detect().


The documentation for this struct was generated from the following file: