libghostty 0.0.4 copy "libghostty: ^0.0.4" to clipboard
libghostty: ^0.0.4 copied to clipboard

Dart FFI bindings to libghostty-vt, the VT emulator library from Ghostty.

example/example.dart

// ignore_for_file: avoid_print

import 'dart:typed_data';

import 'package:libghostty/libghostty.dart';

void main() {
  final terminal = Terminal(cols: 80, rows: 24);

  terminal.write(
    Uint8List.fromList(
      '\x1b[1;34mHello\x1b[0m, \x1b[32mWorld\x1b[0m!\r\n'.codeUnits,
    ),
  );

  final screen = terminal.screen;
  for (var row = 0; row < screen.rows; row++) {
    final text = screen.lineAt(row).text;
    if (text.isNotEmpty) print('Row $row: $text');
  }

  final cell = screen.cellAt(0, 0);
  print('\nFirst cell: "${cell.content}", bold: ${cell.style.bold}');

  terminal.dispose();
}
1
likes
0
points
169
downloads

Publisher

unverified uploader

Weekly Downloads

Dart FFI bindings to libghostty-vt, the VT emulator library from Ghostty.

Repository (GitHub)
View/report issues

Topics

#terminal #emulator #ffi #ghostty #libghostty

License

unknown (license)

Dependencies

code_assets, crypto, ffi, hooks, meta, web

More

Packages that depend on libghostty