G
YouTube TikTok Games
Skip to content
JoshKarpelPublic

About

A Python binding to Ghostty's libghostty-vt, by way of the Rust libghostty-vt crate

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

evp

A Python binding to libghostty-vt, the terminal emulator at the core of Ghostty, built with PyO3 on libghostty-rs and packaged with maturin. Feed it the bytes a program writes to its terminal, and read back what that terminal shows, as values.

from evp import RenderState, Terminal

terminal = Terminal(80, 24, max_scrollback_bytes=10_000_000)
state = RenderState(terminal)

terminal.feed(b"hello, \x1b[1;31mworld\x1b[0m\r\n")

frame = state.frame()
print("".join(frame.rows[0].graphemes).rstrip())  # hello, world

The name is a pun: EVP, electronic voice phenomena, are the voices ghost hunters claim to record, and evp is how Python hears from Ghostty.

Installation

evp is on PyPI, and needs Python 3.13 or newer:

pip install evp

To build it from source, install mise, which provides Rust, Zig, just and uv at the versions in mise.toml, then:

mise install
just build

The first build clones and compiles Ghostty, which takes a few minutes.

Links

About

A Python binding to Ghostty's libghostty-vt, by way of the Rust libghostty-vt crate

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages