ascii-chat
Binary v0.16.50-198-g78f51665f
Library lib/v0.3.2-2240-g78f51665f
Video chat in your terminal
Loading...
Searching...
No Matches
lib/options/registry/terminal.c
Go to the documentation of this file.
1
12
14#include <options/registry/common.h>
15#include <options/registry/metadata.h>
16
17#include <options/parsers.h>
18
19// ============================================================================
20// TERMINAL CATEGORY - Terminal display options
21// ============================================================================
23 // TERMINAL GROUP (client, mirror, discovery)
24 {"width",
25 'x',
27 offsetof(options_t, width),
28 &default_width_value,
29 sizeof(int),
30 "Terminal width in characters. Can be controlled using $COLUMNS. By default your terminal width is detected at "
31 "runtime and this value is updated automatically.",
32 "TERMINAL",
33 NULL,
34 false,
35 "ASCII_CHAT_WIDTH",
36 NULL,
37 NULL,
38 false,
39 false,
41 {.numeric_range = {UI_MEDIA_MIN_COLS, 1024, 0}, .examples = g_width_examples, .input_type = OPTION_INPUT_NUMERIC},
42 NULL},
43 {"height",
44 'y',
46 offsetof(options_t, height),
47 &default_height_value,
48 sizeof(int),
49 "Terminal height in characters. Can be controlled using $ROWS. By default your terminal height is detected at "
50 "runtime and this value is updated automatically.",
51 "TERMINAL",
52 NULL,
53 false,
54 "ASCII_CHAT_HEIGHT",
55 NULL,
56 NULL,
57 false,
58 false,
60 {.numeric_range = {UI_MEDIA_MIN_ROWS, 1024, 0}, .examples = g_height_examples, .input_type = OPTION_INPUT_NUMERIC},
61 NULL},
62 {"color-mode",
63 '\0',
65 offsetof(options_t, color_mode),
66 &default_color_mode_value,
67 sizeof(terminal_color_mode_t),
68 "Terminal color level (auto, none, 16, 256, truecolor). This controls what ANSI escape codes ascii-chat will use "
69 "for console logging and display output if color is enabled. Press 'c' during rendering to cycle. See also "
70 "--color.",
71 "TERMINAL",
72 NULL,
73 false,
74 "ASCII_CHAT_COLOR_MODE",
75 NULL,
77 false,
78 false,
80 {.enum_values = g_color_mode_values, .enum_descriptions = g_color_mode_descs, .enum_integer_values = g_color_mode_integers, .input_type = OPTION_INPUT_ENUM},
81 NULL},
82 {"show-capabilities",
83 '\0',
85 0,
86 NULL,
87 0,
88 "Show detected terminal capabilities and exit (useful for debugging and scripting).",
89 "TERMINAL",
90 NULL,
91 false,
92 NULL,
93 NULL,
94 NULL,
95 false,
96 false,
98 {0},
99 NULL},
100 {"utf8",
101 '\0',
103 offsetof(options_t, force_utf8),
104 &default_force_utf8_value,
105 sizeof(int),
106 "UTF-8 support setting: 'auto' (default, auto-detect), 'true' (force UTF-8 on), or 'false' (force UTF-8 off).",
107 "TERMINAL",
108 NULL,
109 false,
110 "ASCII_CHAT_UTF8",
111 NULL,
113 false,
114 true,
116 {.enum_values = g_utf8_setting_values, .enum_descriptions = g_utf8_setting_descs, .enum_integer_values = g_utf8_setting_integers, .input_type = OPTION_INPUT_ENUM},
117 NULL},
118 {"strip-ansi",
119 '\0',
121 offsetof(options_t, strip_ansi),
122 &default_strip_ansi_value,
123 sizeof(bool),
124 "Strip ANSI escape sequences from output before printing. Useful for scripting and debugging.",
125 "TERMINAL",
126 NULL,
127 false,
128 "ASCII_CHAT_STRIP_ANSI",
129 NULL,
130 NULL,
131 false,
132 false,
134 {0},
135 NULL},
136 {"color",
137 '\0',
139 offsetof(options_t, color),
140 &default_color_value,
141 sizeof(int),
142 "Color output setting: 'auto' (default, smart detection), 'true' (force colors on), or 'false' (force colors "
143 "off).",
144 "TERMINAL",
145 NULL,
146 false,
147 "ASCII_CHAT_COLOR",
148 NULL,
150 false,
151 true,
153 {.enum_values = g_color_setting_values, .enum_descriptions = g_color_setting_descs, .enum_integer_values = g_color_setting_integers, .input_type = OPTION_INPUT_ENUM},
154 NULL},
155
@ OPTION_INPUT_NUMERIC
Numeric value with optional min/max/step.
Definition builder.h:188
@ OPTION_INPUT_ENUM
Choose from fixed set of enum values.
Definition builder.h:187
@ OPTION_TYPE_INT
Integer value (–count 42).
Definition builder.h:172
@ OPTION_TYPE_ACTION
Action that executes and may exit (–list-webcams, etc.).
Definition builder.h:176
@ OPTION_TYPE_CALLBACK
Custom parser function.
Definition builder.h:175
@ OPTION_TYPE_BOOL
Boolean flag (–flag, no value).
Definition builder.h:171
int color_mode
Definition fft.c:26
unsigned int height
Definition fft.c:24
unsigned int width
Definition fft.c:24
struct options_state options_t
Immutable, RCU-published snapshot of the application's runtime configuration.
@ OPTION_MODE_ALL
All modes + binary.
Definition options.h:943
@ OPTION_MODE_BINARY
Binary-level options (parsed before mode detection).
Definition options.h:942
@ OPTION_MODE_CLIENT
Client mode (bit 1).
Definition options.h:936
@ OPTION_MODE_DISCOVERY
Discovery mode (bit 4).
Definition options.h:939
@ OPTION_MODE_MIRROR
Mirror mode (bit 2).
Definition options.h:937
const registry_entry_t g_terminal_entries[]
#define REGISTRY_TERMINATOR()
Initialize a terminator entry (sentinel value for array end) Uses designated initializers to properly...
const char * g_height_examples[]
Definition metadata.c:145
const int g_color_setting_integers[]
Definition metadata.c:38
const char * g_color_mode_values[]
Definition metadata.c:54
const char * g_width_examples[]
Definition metadata.c:144
const char * g_color_setting_descs[]
Definition metadata.c:39
const char * g_utf8_setting_values[]
Definition metadata.c:45
const int g_utf8_setting_integers[]
Definition metadata.c:46
const char * g_utf8_setting_descs[]
Definition metadata.c:47
const char * g_color_setting_values[]
Definition metadata.c:37
const char * g_color_mode_descs[]
Definition metadata.c:56
const int g_color_mode_integers[]
Definition metadata.c:55
bool parse_color_setting(const char *arg, void *dest, char **error_msg)
Parse color setting option (–color flag).
Definition parsers.c:105
bool parse_color_mode(const char *arg, void *dest, char **error_msg)
Parse terminal color level option.
Definition parsers.c:151
bool parse_utf8_setting(const char *arg, void *dest, char **error_msg)
Parse UTF-8 setting option (–utf8 flag).
Definition parsers.c:132
Custom option parsers for enum types.
Registry entry - stores option definition with mode bitmask and metadata.
#define UI_MEDIA_MIN_COLS
Definition too_small.h:9
#define UI_MEDIA_MIN_ROWS
Definition too_small.h:10