vt100wasm
raw JSON → 0.3.0 verified Fri May 01 auth: no python
Python bindings for vt100 terminal state processing via WebAssembly. Provides terminal emulation with vt100 escape sequence parsing, capable of handling complex terminal interactions. Version 0.3.0 (latest) as of May 2026. Release cadence is irregular; pre-v1.0 so breaking changes are possible.
pip install vt100wasm Common errors
error TypeError: a bytes-like object is required, not 'str' ↓
cause Passing a string to Terminal.feed() instead of bytes.
fix
Use term.feed(your_string.encode('utf-8')) or directly pass bytes.
error AttributeError: module 'vt100wasm' has no attribute 'Terminal' ↓
cause Incorrect import path: using import vt100wasm and then vt100wasm.Terminal, but Terminal is not exported at the top level in some older versions.
fix
Use from vt100wasm import Terminal or import vt100wasm; vt100wasm.Terminal (check version: from 0.3.0 it should be available).
Warnings
breaking The Terminal.feed() method expects bytes, not str. Passing a string will raise a TypeError. ↓
fix Encode strings to bytes before feeding, e.g., term.feed(b'text') or term.feed('text'.encode()).
breaking The library is pre-1.0 (v0.3.0), so breaking changes may occur without a major version bump. ↓
fix Pin your dependency to a specific version and test upgrades carefully.
gotcha The Terminal does not automatically manage the cursor; you must manually track cursor position if needed. ↓
fix Use the cursor position from escape sequence feedback or manage it externally.
Imports
- Terminal
from vt100wasm import Terminal - TerminalError
from vt100wasm import TerminalError
Quickstart
from vt100wasm import Terminal
# Create a terminal with 80 columns and 24 rows
term = Terminal(width=80, height=24)
# Feed some terminal output
term.feed(b'\x1b[31mHello\x1b[0m')
# Get the cell content
cell = term.cell(0, 0)
print(cell.char, cell.fg_color, cell.bg_color)