write method
Write data to the pseudo-terminal.
Returns false if the process has been destroyed or native backpressure rejected the write.
Implementation
bool write(Uint8List data) {
if (_isDestroyed || data.isEmpty) return false;
final buf = malloc<Int8>(data.length);
buf.asTypedList(data.length).setAll(0, data);
final written = _bindings.pty_write(_handle, buf.cast(), data.length) != 0;
malloc.free(buf);
return written;
}