libghostty
Loading...
Searching...
No Matches
osc.h
Go to the documentation of this file.
1
6
7#ifndef GHOSTTY_VT_OSC_H
8#define GHOSTTY_VT_OSC_H
9
10#include <stdbool.h>
11#include <stddef.h>
12#include <stdint.h>
13#include <ghostty/vt/types.h>
15
105
111typedef enum GHOSTTY_ENUM_TYPED {
112 GHOSTTY_OSC_COMMAND_INVALID = 0,
113 GHOSTTY_OSC_COMMAND_CHANGE_WINDOW_TITLE = 1,
114 GHOSTTY_OSC_COMMAND_CHANGE_WINDOW_ICON = 2,
115 GHOSTTY_OSC_COMMAND_SEMANTIC_PROMPT = 3,
116 GHOSTTY_OSC_COMMAND_CLIPBOARD_CONTENTS = 4,
117 GHOSTTY_OSC_COMMAND_REPORT_PWD = 5,
118 GHOSTTY_OSC_COMMAND_MOUSE_SHAPE = 6,
119 GHOSTTY_OSC_COMMAND_COLOR_OPERATION = 7,
120 GHOSTTY_OSC_COMMAND_KITTY_COLOR_PROTOCOL = 8,
121 GHOSTTY_OSC_COMMAND_SHOW_DESKTOP_NOTIFICATION = 9,
122 GHOSTTY_OSC_COMMAND_HYPERLINK_START = 10,
123 GHOSTTY_OSC_COMMAND_HYPERLINK_END = 11,
124 GHOSTTY_OSC_COMMAND_CONEMU_SLEEP = 12,
125 GHOSTTY_OSC_COMMAND_CONEMU_SHOW_MESSAGE_BOX = 13,
126 GHOSTTY_OSC_COMMAND_CONEMU_CHANGE_TAB_TITLE = 14,
127 GHOSTTY_OSC_COMMAND_CONEMU_PROGRESS_REPORT = 15,
128 GHOSTTY_OSC_COMMAND_CONEMU_WAIT_INPUT = 16,
129 GHOSTTY_OSC_COMMAND_CONEMU_GUIMACRO = 17,
130 GHOSTTY_OSC_COMMAND_CONEMU_RUN_PROCESS = 18,
131 GHOSTTY_OSC_COMMAND_CONEMU_OUTPUT_ENVIRONMENT_VARIABLE = 19,
132 GHOSTTY_OSC_COMMAND_CONEMU_XTERM_EMULATION = 20,
133 GHOSTTY_OSC_COMMAND_CONEMU_COMMENT = 21,
134 GHOSTTY_OSC_COMMAND_KITTY_TEXT_SIZING = 22,
135 GHOSTTY_OSC_COMMAND_KITTY_CLIPBOARD_PROTOCOL = 23,
136 GHOSTTY_OSC_COMMAND_KITTY_DND_PROTOCOL = 24,
137 GHOSTTY_OSC_COMMAND_HIERARCHICAL_CONTEXT = 25,
138 GHOSTTY_OSC_COMMAND_KITTY_DESKTOP_NOTIFICATION = 26,
139
148
158 GHOSTTY_OSC_COMMAND_TYPE_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
160
170typedef enum GHOSTTY_ENUM_TYPED {
173
176 GHOSTTY_OSC_TERMINATOR_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
178
184typedef enum GHOSTTY_ENUM_TYPED {
205 GHOSTTY_OSC_OPT_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
207
216typedef enum GHOSTTY_ENUM_TYPED {
219
231
246
257
268 GHOSTTY_OSC_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
270
284GHOSTTY_API GhosttyResult ghostty_osc_new(const GhosttyAllocator *allocator, GhosttyOscParser *parser);
285
296GHOSTTY_API void ghostty_osc_free(GhosttyOscParser parser);
297
309GHOSTTY_API void ghostty_osc_reset(GhosttyOscParser parser);
310
331 GhosttyOscOption option,
332 const void* value);
333
349GHOSTTY_API void ghostty_osc_next(GhosttyOscParser parser, uint8_t byte);
350
383GHOSTTY_API GhosttyOscCommand ghostty_osc_end(GhosttyOscParser parser, uint8_t terminator);
384
398
414GHOSTTY_API bool ghostty_osc_command_data(GhosttyOscCommand command, GhosttyOscCommandData data, void *out);
415
417
418#endif /* GHOSTTY_VT_OSC_H */
GHOSTTY_API void ghostty_osc_reset(GhosttyOscParser parser)
GHOSTTY_API GhosttyOscCommandType ghostty_osc_command_type(GhosttyOscCommand command)
GHOSTTY_API GhosttyOscCommand ghostty_osc_end(GhosttyOscParser parser, uint8_t terminator)
GHOSTTY_API GhosttyResult ghostty_osc_set(GhosttyOscParser parser, GhosttyOscOption option, const void *value)
GhosttyOscOption
Definition osc.h:184
GhosttyOscTerminator
Definition osc.h:170
GhosttyOscCommandData
Definition osc.h:216
GhosttyOscCommandType
Definition osc.h:111
GHOSTTY_API void ghostty_osc_next(GhosttyOscParser parser, uint8_t byte)
struct GhosttyOscParserImpl * GhosttyOscParser
Definition types.h:237
GHOSTTY_API GhosttyResult ghostty_osc_new(const GhosttyAllocator *allocator, GhosttyOscParser *parser)
GHOSTTY_API bool ghostty_osc_command_data(GhosttyOscCommand command, GhosttyOscCommandData data, void *out)
struct GhosttyOscCommandImpl * GhosttyOscCommand
Definition types.h:247
GHOSTTY_API void ghostty_osc_free(GhosttyOscParser parser)
@ GHOSTTY_OSC_OPT_UNKNOWN_MAX_BYTES
Definition osc.h:204
@ GHOSTTY_OSC_TERMINATOR_ST
Definition osc.h:172
@ GHOSTTY_OSC_TERMINATOR_BEL
Definition osc.h:175
@ GHOSTTY_OSC_DATA_UNKNOWN_TRUNCATED
Definition osc.h:256
@ GHOSTTY_OSC_DATA_INVALID
Definition osc.h:218
@ GHOSTTY_OSC_DATA_CHANGE_WINDOW_TITLE_STR
Definition osc.h:230
@ GHOSTTY_OSC_DATA_UNKNOWN_TERMINATOR
Definition osc.h:267
@ GHOSTTY_OSC_DATA_UNKNOWN_CONTENT
Definition osc.h:245
@ GHOSTTY_OSC_COMMAND_PROGRAM_STATUS
Definition osc.h:157
@ GHOSTTY_OSC_COMMAND_UNKNOWN
Definition osc.h:147
GhosttyResult
Definition types.h:88
#define GHOSTTY_ENUM_TYPED
Definition types.h:81