ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
terminal.c File Reference

Terminal display options. More...

Go to the source code of this file.

Variables

const registry_entry_t g_terminal_entries []
 

Detailed Description

Terminal display options.

Options for controlling terminal dimensions, color modes, UTF-8 support, and terminal capabilities.

Author
Zachary Fogg me@zf.nosp@m.o.gg
Date
January 2026

Definition in file options/registry/terminal.c.

Variable Documentation

◆ g_terminal_entries

const registry_entry_t g_terminal_entries[]

Definition at line 21 of file options/registry/terminal.c.

21 {
22 // TERMINAL GROUP (client, mirror, discovery)
23 {"width",
24 'x',
26 offsetof(options_t, width),
27 &default_width_value,
28 sizeof(int),
29 "Terminal width in characters. Can be controlled using $COLUMNS. By default your terminal width is detected at "
30 "runtime and this value is updated automatically.",
31 "TERMINAL",
32 NULL,
33 false,
34 "ASCII_CHAT_WIDTH",
35 NULL,
36 NULL,
37 false,
38 false,
40 {.numeric_range = {20, 1024, 0}, .examples = g_width_examples, .input_type = OPTION_INPUT_NUMERIC},
41 NULL},
42 {"height",
43 'y',
45 offsetof(options_t, height),
46 &default_height_value,
47 sizeof(int),
48 "Terminal height in characters. Can be controlled using $ROWS. By default your terminal height is detected at "
49 "runtime and this value is updated automatically.",
50 "TERMINAL",
51 NULL,
52 false,
53 "ASCII_CHAT_HEIGHT",
54 NULL,
55 NULL,
56 false,
57 false,
59 {.numeric_range = {10, 1024, 0}, .examples = g_height_examples, .input_type = OPTION_INPUT_NUMERIC},
60 NULL},
61 {"color-mode",
62 '\0',
64 offsetof(options_t, color_mode),
65 &default_color_mode_value,
67 "Terminal color level (auto, none, 16, 256, truecolor). This controls what ANSI escape codes ascii-chat will use "
68 "for console logging and display output if color is enabled. Press 'c' during rendering to cycle. See also "
69 "--color.",
70 "TERMINAL",
71 NULL,
72 false,
73 "ASCII_CHAT_COLOR_MODE",
74 NULL,
76 false,
77 false,
79 {.enum_values = g_color_mode_values,
80 .enum_descriptions = g_color_mode_descs,
81 .enum_integer_values = g_color_mode_integers,
82 .input_type = OPTION_INPUT_ENUM},
83 NULL},
84 {"show-capabilities",
85 '\0',
87 0,
88 NULL,
89 0,
90 "Show detected terminal capabilities and exit (useful for debugging and scripting).",
91 "TERMINAL",
92 NULL,
93 false,
94 NULL,
95 NULL,
96 NULL,
97 false,
98 false,
100 {0},
101 NULL},
102 {"utf8",
103 '\0',
105 offsetof(options_t, force_utf8),
106 &default_force_utf8_value,
107 sizeof(int),
108 "UTF-8 support setting: 'auto' (default, auto-detect), 'true' (force UTF-8 on), or 'false' (force UTF-8 off).",
109 "TERMINAL",
110 NULL,
111 false,
112 "ASCII_CHAT_UTF8",
113 NULL,
115 false,
116 true,
118 {.enum_values = g_utf8_setting_values,
119 .enum_descriptions = g_utf8_setting_descs,
120 .enum_integer_values = g_utf8_setting_integers,
121 .input_type = OPTION_INPUT_ENUM},
122 NULL},
123 {"strip-ansi",
124 '\0',
126 offsetof(options_t, strip_ansi),
127 &default_strip_ansi_value,
128 sizeof(bool),
129 "Strip ANSI escape sequences from output before printing. Useful for scripting and debugging.",
130 "TERMINAL",
131 NULL,
132 false,
133 "ASCII_CHAT_STRIP_ANSI",
134 NULL,
135 NULL,
136 false,
137 false,
139 {0},
140 NULL},
141 {"color",
142 '\0',
144 offsetof(options_t, color),
145 &default_color_value,
146 sizeof(int),
147 "Color output setting: 'auto' (default, smart detection), 'true' (force colors on), or 'false' (force colors "
148 "off).",
149 "TERMINAL",
150 NULL,
151 false,
152 "ASCII_CHAT_COLOR",
153 NULL,
155 false,
156 true,
158 {.enum_values = g_color_setting_values,
159 .enum_descriptions = g_color_setting_descs,
160 .enum_integer_values = g_color_setting_integers,
161 .input_type = OPTION_INPUT_ENUM},
162 NULL},
163
@ OPTION_INPUT_NUMERIC
Numeric value with optional min/max/step.
Definition builder.h:179
@ OPTION_INPUT_ENUM
Choose from fixed set of enum values.
Definition builder.h:178
@ OPTION_TYPE_INT
Integer value (–count 42)
Definition builder.h:163
@ OPTION_TYPE_ACTION
Action that executes and may exit (–list-webcams, etc.)
Definition builder.h:167
@ OPTION_TYPE_CALLBACK
Custom parser function.
Definition builder.h:166
@ OPTION_TYPE_BOOL
Boolean flag (–flag, no value)
Definition builder.h:162
@ OPTION_MODE_BINARY
Binary-level options (parsed before mode detection)
@ OPTION_MODE_CLIENT
Client mode (bit 1)
@ OPTION_MODE_DISCOVERY
Discovery mode (bit 4)
@ OPTION_MODE_MIRROR
Mirror mode (bit 2)
const char * g_height_examples[]
Definition metadata.c:183
const int g_color_setting_integers[]
Definition metadata.c:44
const char * g_color_mode_values[]
Definition metadata.c:63
const char * g_width_examples[]
Definition metadata.c:182
const char * g_color_setting_descs[]
Definition metadata.c:45
const char * g_utf8_setting_values[]
Definition metadata.c:53
const int g_utf8_setting_integers[]
Definition metadata.c:54
const char * g_utf8_setting_descs[]
Definition metadata.c:55
const char * g_color_setting_values[]
Definition metadata.c:43
const char * g_color_mode_descs[]
Definition metadata.c:67
const int g_color_mode_integers[]
Definition metadata.c:65
#define REGISTRY_TERMINATOR()
Initialize a terminator entry (sentinel value for array end) Uses designated initializers to properly...
bool parse_color_setting(const char *arg, void *dest, char **error_msg)
Parse color setting option (–color flag)
Definition parsers.c:160
bool parse_color_mode(const char *arg, void *dest, char **error_msg)
Parse terminal color level option.
Definition parsers.c:210
bool parse_utf8_setting(const char *arg, void *dest, char **error_msg)
Parse UTF-8 setting option (–utf8 flag)
Definition parsers.c:191
#define bool
Definition stdbool.h:61
Consolidated options structure.
terminal_color_mode_t
Terminal color support levels.
Definition terminal.h:578