Pack DEC and ANSI mode numbers into a GhosttyMode and encode a DECRPM report.
#include <stdio.h>
void modes_example() {
printf("value=%u ansi=%d packed=0x%04x\n",
ghostty_mode_value(tag),
ghostty_mode_ansi(tag),
tag);
printf("value=%u ansi=%d packed=0x%04x\n",
ghostty_mode_value(ansi_tag),
ghostty_mode_ansi(ansi_tag),
ansi_tag);
}
void decrpm_example() {
uint8_t buf[32];
size_t written = 0;
buf, sizeof(buf), &written);
printf("Encoded %zu bytes: ", written);
fwrite(buf, 1, written, stdout);
printf("\n");
}
}
int main() {
modes_example();
decrpm_example();
return 0;
}
#define GHOSTTY_MODE_CURSOR_VISIBLE
GHOSTTY_API GhosttyResult ghostty_mode_report_encode(GhosttyMode mode, GhosttyModeReportState state, uint8_t *buf, size_t buf_len, size_t *out_written)
@ GHOSTTY_MODE_REPORT_SET