writeBytes method

void writeBytes(
  1. List<int> bytes
)

Writes raw VT-encoded bytes into the terminal stream.

Implementation

void writeBytes(List<int> bytes) {
  _ensureOpen();
  if (bytes.isEmpty) {
    return;
  }
  final ptr = calloc<ffi.Uint8>(bytes.length);
  try {
    ptr.asTypedList(bytes.length).setAll(0, bytes);
    bindings.ghostty_terminal_vt_write(_handle, ptr, bytes.length);
  } finally {
    calloc.free(ptr);
  }
}