libghostty-vt
0.0.0
Toggle main menu visibility
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() {
GhosttySizeReportSize
size = {
.rows = 24,
.columns = 80,
.cell_width = 9,
.cell_height = 18,
};
uint8_t buf[64];
size_t
written = 0;
GhosttyResult
result =
ghostty_size_report_encode
(
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
GhosttyResult
Definition
types.h:143
GHOSTTY_SUCCESS
@ GHOSTTY_SUCCESS
Definition
types.h:145
ghostty_size_report_encode
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
@ GHOSTTY_SIZE_REPORT_MODE_2048
Definition
size_report.h:45
GhosttySizeReportSize
Definition
size_report.h:63
vt.h
Generated by
1.17.0