libghostty-vt 0.0.0
Loading...
Searching...
No Matches
c-vt-size-report/src/main.c

Encode an in-band size report (mode 2048) from the grid and cell size.

#include <stdio.h>
#include <ghostty/vt.h>
int main() {
.rows = 24,
.columns = 80,
.cell_width = 9,
.cell_height = 18,
};
uint8_t buf[64];
size_t written = 0;
GHOSTTY_SIZE_REPORT_MODE_2048, &size, buf, sizeof(buf), &written);
if (result == GHOSTTY_SUCCESS) {
printf("Encoded %zu bytes: ", written);
fwrite(buf, 1, written, stdout);
printf("\n");
}
return 0;
}
GhosttyResult
Definition types.h:143
@ GHOSTTY_SUCCESS
Definition types.h:145
GHOSTTY_API GhosttyResult ghostty_size_report_encode(GhosttySizeReportStyle style, const GhosttySizeReportSize *size, uint8_t *buf, size_t buf_len, size_t *out_written)
@ GHOSTTY_SIZE_REPORT_MODE_2048
Definition size_report.h:45