encodeSizeReport static method

Uint8List encodeSizeReport(
  1. GhosttySizeReportStyle style,
  2. VtSizeReportSize size
)

Encodes a terminal size report into bytes.

Implementation

static Uint8List encodeSizeReport(
  bindings.GhosttySizeReportStyle style,
  VtSizeReportSize size,
) {
  final nativeSize = calloc<bindings.GhosttySizeReportSize>();
  try {
    size._writeTo(nativeSize.ref);
    return _encodeCharSequence(
      'ghostty_size_report_encode',
      (buffer, length, outWritten) => bindings.ghostty_size_report_encode(
        style,
        nativeSize.ref,
        buffer,
        length,
        outWritten,
      ),
    );
  } finally {
    calloc.free(nativeSize);
  }
}