Ghostty (Ghostty v0.4.7)

Copy Markdown View Source

Terminal emulator library for the BEAM.

Wraps libghostty-vt — the virtual terminal extracted from Ghostty. SIMD-optimized VT parsing, full Unicode, 24-bit color, scrollback with text reflow. Terminals are GenServers.

Quick start

{:ok, term} = Ghostty.Terminal.start_link(cols: 80, rows: 24)

Ghostty.Terminal.write(term, "Hello, \e[1;32mworld\e[0m!\r\n")

{:ok, text} = Ghostty.Terminal.snapshot(term)
# => "Hello, world!"

Supervision

children = [
  {Ghostty.Terminal, name: :console, cols: 120, rows: 40}
]
Supervisor.start_link(children, strategy: :one_for_one)