Par Term Emu Core Rust
A comprehensive terminal emulator library written in Rust with Python bindings for Python 3.12+. Provides VT100/VT220/VT320/VT420/VT520 compatibility with PTY support, matching iTerm2's feature set.
What's New
Note: For the complete release history, see CHANGELOG.md. The entries below cover the most recent releases; the full history for older versions lives in CHANGELOG.md.
Version 0.58.0 is a minor release with breaking changes for C/Swift and Rust embedders: the C FFI lands its v4 ABI revision — every export is ptec_-prefixed, SharedCell colors resolve through the live palette with ptec_terminal_read_cell_grapheme for full graphemes, and observers receive structured on_event_v2 events — plus v5 scroll-aware damage (ENH-038) so renderers blit on scroll and redraw only changed rows. Python per-cell colors follow the palette and OSC 10/11 defaults too (ARC-101), and the deprecated bridges are gone (poll_events_legacy, Grid::erase_rectangle). par-mux gains held-dead panes that survive a daemon restart (ARC-114), list-commands discovery with held-state replay on registration (ENH-037), pane-exited-replay, clear-history, and opt-in per-pane hook-only endpoints (ENH-039). Feature flags split (mux-bin, macro-yaml), Cargo.lock is committed and release builds are --locked (ARC-107), core diagnostics reach the log facade (ARC-111), the streaming server is load-hardened (QA-184/191/192/198), and a large audit batch lands security and robustness fixes (SEC-125–SEC-134). See CHANGELOG.md for complete release notes.
Version 0.57.0 is a minor release focused on par-mux layout and lifecycle: panes can be zoomed (resize-pane -Z), reorganized with break-pane/join-pane/move-window/swap-window, and a pane whose child exits is now held with its exit code (remain-on-exit) and brought back with respawn-pane; split-window -b places a new pane before its target, and pane-info replies gain an optional trailing cmd=<base64> foreground-command token. The shared key encoder covers modifyOtherKeys and the macOS option-key modes (ENH-028; new Terminal.encode_key Python binding and FFI terminal_encode_key_ex), the stub generator emits real constructor signatures (ENH-030), FFI dirty-range readback is allocation-free (ENH-026), and par-mux telemetry is validated by a typed TelemetryV1 schema that rejects future-dated samples (ENH-029, QA-156). See CHANGELOG.md for complete release notes.
Version 0.56.0 is a minor release with Rust-embedder breaking changes: the 29 deprecated Terminal macro/trigger forwarders are removed on the 0.54.0 schedule (use terminal::MacroEngine/TriggerEngine; the Python API is unchanged), TermKeyEvent.key is now a plain u16 validated via TermKey::from_raw (an invalid discriminant is Unknown, not UB), and KittyParser::get_data returns Result. Headline additions: the C FFI on-device embedding surface (terminal_feed/terminal_dirty_ranges/pinned-buffer row readback/terminal_encode_key, with a cbindgen-generated, drift-gated terminal_core.h and make xcframework for iOS), per-consumer damage generations (Python damage_generation()/dirty_rows_since(); FFI ABI v2), par-mux rename-session/kill-session, and triggers that observe written text rather than render damage. Security: the par-mux host probe never runs repo-configured code (SEC-115), the Kitty path is bounded end to end against decompression bombs (SEC-116), and FFI string lengths always equal strlen (SEC-117). See CHANGELOG.md for complete release notes.
Version 0.55.0 is a minor release whose headline is the scheduled removal of the deprecated Terminal screenshot/benchmark forwarders (Rust embedders only): Terminal::screenshot/screenshot_to_file and Terminal::benchmark_rendering/benchmark_parsing/benchmark_grid_ops/run_benchmark_suite are gone, as promised by 0.54.0's deprecation schedule — use the crate::screenshot::render_terminal/save_terminal free functions and terminal::TerminalBenchmarks. The Python API surface is unchanged. Also ships the par-mux agent-telemetry enabler: a pane.report_agent_telemetry hook endpoint, telemetry served on list-agents rows with the %agent-telemetry-changed broadcast, and a host telemetry probe (disk-free percent and git state per pane cwd) swept by the daemon itself. See CHANGELOG.md for complete release notes.
Every other release is documented in CHANGELOG.md.
Features
Core Terminal Emulation
- VT100/VT220/VT320/VT420/VT520 Support - Comprehensive terminal emulation matching iTerm2
- Rich Color Support - 16 ANSI colors, 256-color palette, 24-bit RGB (true color)
- Text Attributes - Bold, italic, underline (5 styles), strikethrough, blink, reverse, dim, hidden
- Advanced Cursor Control - Full VT cursor movement and positioning
- Line/Character Editing - VT220 insert/delete operations
- Rectangle Operations - VT420 fill/copy/erase/modify rectangular regions (DECFRA, DECCRA, etc.)
- Scrolling Regions - DECSTBM for restricted scrolling areas
- Tab Stops - Configurable tab stops (HTS, TBC, CHT, CBT)
- Unicode Support - Full Unicode including complex emoji sequences and grapheme clusters
- Variation selectors (emoji vs text presentation)
- Skin tone modifiers (Fitzpatrick scale U+1F3FB-U+1F3FF)
- Zero Width Joiner (ZWJ) sequences for multi-emoji glyphs
- Regional indicators for flag emoji
- Combining characters and diacritical marks
Modern Features
- Alternate Screen Buffer - Full support with automatic cleanup
- Mouse Support - Multiple tracking modes and encodings (X10, Normal, Button, Any, SGR, URXVT)
- Bracketed Paste Mode - Safe paste handling
- Focus Tracking - Focus in/out events
- OSC 8 Hyperlinks - Clickable URLs in terminal (full TUI support)
- OSC 52 Clipboard - Copy/paste over SSH without X11
- OSC 9/777/99 Notifications - Desktop-style alerts and notifications, including Kitty's OSC 99 protocol (chunked payloads, urgency levels, actions) via
take_notifications_detailed() - Terminal Capability Queries - XTGETTCAP (
DCS + q) capability lookup and DECRQSS (DCS $ q) SGR/cursor-style/scroll-margin introspection - Expanded XTWINOPS Reporting -
CSI 11/13/19 treport window state, position, and screen size in characters - Shell Integration - OSC 133 (iTerm2/VSCode compatible), OSC 1337 RemoteHost for remote host detection
- Semantic Buffer Zones - OSC 133 FinalTerm markers partition scrollback into prompt, command, and output zones
- Command Output Capture - Extract text from specific command execution blocks via
get_command_output()andget_command_outputs() - Semantic Snapshot API - Structured terminal state extraction via
get_semantic_snapshot()for AI/LLM consumption, with configurable scope (visible, recent, full) and JSON output - Kitty Keyboard Protocol - Progressive keyboard enhancement with auto-reset on alternate screen exit
- Synchronized Updates (DEC 2026) - Flicker-free rendering
- Tmux Control Protocol - Control mode integration support
- Observer API - Push-based event delivery with sync callbacks and async queues; convenience wrappers for common patterns (bell, title, CWD, command completion, zone changes)
- General-purpose File Transfer - OSC 1337
File=withinline=0for host-to-terminal downloads,RequestUploadfor terminal-to-host uploads, with progress tracking and lifecycle events - Instant Replay - Cell-level terminal snapshots with input-stream delta recording, size-based eviction, and timeline navigation via
SnapshotManagerandReplaySession - C-Compatible FFI - embedding API in
include/terminal_core.h(ptec_terminal_create/feed/dirty_ranges/read_rowrender loop, key encoding, snapshots, observers;SharedState/SharedCell) for C/C++ and Swift apps — see the FFI Guide andmake xcframeworkfor iOS
Graphics Support
- Sixel Graphics - DEC VT340 compatible bitmap graphics with half-block rendering
- iTerm2 Inline Images - OSC 1337 protocol for PNG, JPEG, GIF images
- Kitty Graphics Protocol - APC G protocol with image reuse, animations, zlib compression (
o=z), and advanced placement; thet=f/t=tfile media is security-gated (set_allow_file_media, default allows only spec-named*tty-graphics-protocol*temp files, deleted only after decoding) - Unicode Placeholders - Virtual placements insert U+10EEEE characters for inline image display
- Unified Graphics Store - Protocol-agnostic storage with scrollback support
- Animation Support - Frame-based animations with timing and composition control
- Resource Management - Configurable memory limits and graphics dropped tracking
PTY Support
- Interactive Shell Sessions - Spawn and control shell processes
- Bidirectional I/O - Send input and receive output
- Process Management - Start, stop, and monitor child processes
- Dynamic Resizing - Resize with SIGWINCH signal
- Environment Control - Custom environment variables and working directory
- Event Loop Integration - Non-blocking update detection
- Cross-Platform - Linux, macOS, and Windows via portable-pty
Terminal Streaming (WebSocket)
- Standalone Server - Pure Rust streaming server binary (no Python required)
- Real-time Streaming - Sub-100ms latency terminal streaming over WebSocket
- Multiple Clients - Support for concurrent viewers per session
- Authentication - Optional API key authentication (header or URL param)
- Configurable Themes - Multiple built-in color themes (iTerm2, Monokai, Dracula, Solarized)
- Auto-resize - Client-initiated terminal resizing with SIGWINCH support
- Browser Compatible - Works with any WebSocket client (xterm.js recommended)
- Modern Web Frontend - Next.js/React application with Tailwind CSS v4 and xterm.js
Terminal Multiplexer (par-mux)
- tmux Control Mode - Sessions, windows, and split panes served over a local socket, attachable by tmux control-mode clients
- Real-Time Push - Pane output streams to clients as bytes arrive; no polling
- Agent Awareness - Panes report agent state over the same socket (JSON hook reports), with a scrape fallback for agents without hooks and an agent roster query
- Session Resume - Agent session identity persists across daemon restarts; agent panes respawn through their resume invocations
- Crash-Safe State - Atomic saves with quarantine of unreadable state files; a clean SIGTERM never loses the last window
Screenshots and Export
- Multiple Formats - PNG, JPEG, BMP, SVG (vector); HTML via
export_html() - Embedded Font - JetBrains Mono bundled - no installation required
- Programming Ligatures - =>, !=, >=, and other code ligatures
- True Font Rendering - High-quality antialiasing for raster formats
- Color Emoji Support - Full emoji rendering with automatic font fallback
- Session Recording - Record/replay sessions (asciicast v2, JSON)
- Export Functions - Plain text, ANSI styled, HTML export
Macro Recording and Playback
- YAML Format - Human-readable macro storage format
- Friendly Key Names - Intuitive key combinations (
ctrl+shift+s,enter,f1, etc.) - Keyboard Events - Record and replay keyboard input with precise timing
- Delays - Control timing between events
- Screenshot Triggers - Trigger screenshots during playback
- Playback Controls - Play, pause, resume, stop, and speed control
- Macro Library - Store and manage multiple macros
- Recording Conversion - Convert terminal recording sessions to macros
Utility Functions
- Text Extraction - Smart word/URL detection, selection boundaries, bracket matching
- Content Search - Find text with case-sensitive/insensitive matching
- Buffer Statistics - Memory usage, cell counts, graphics count and memory tracking
- Color Utilities - 18+ color manipulation functions (iTerm2-compatible)
- NTSC brightness, contrast adjustment, WCAG accessibility checks
- Color space conversions (RGB, HSL, Hex, ANSI 256)
- Saturation/hue adjustment, color mixing
Documentation
- Quick Start Guide - Get running in minutes
- API Reference - Complete Python API documentation
- VT Sequences - Comprehensive ANSI/VT sequence reference
- Advanced Features - Detailed feature guides
- Architecture - Internal architecture details
- Security - PTY security best practices
- Building - Build instructions and requirements
- Configuration Reference - Configuration options
- Cross-Platform Notes - Platform-specific information
- VT Technical Reference - Detailed VT compatibility and implementation
- Fonts - Font configuration and rendering
- Macros - Macro recording and playback system
- Streaming - WebSocket terminal streaming
- Multiplexer - par-mux terminal multiplexer daemon
- Rust Usage - Using the library in pure Rust projects
- Observers - Push-based event delivery (callbacks and asyncio queues)
- Instant Replay - Cell-level snapshots and timeline navigation
- FFI Guide - C-compatible embedding API for Swift/JNI/C/C++
- Graphics Testing - Testing graphics protocol implementations
- Benchmarking - Criterion throughput benches and interleaved A/B comparison
- Testing Kitty Animations - Testing Kitty graphics animation support
- Regional Flag Limitation - Why regional-indicator flag emoji may not render as one glyph in some frontends
- Maturin Best Practices - Wheel build and packaging compliance review
- par-mux Design Pointer - Where the par-mux design plan lives
- par-mux Design Decisions - One-line summaries of the D-numbered decisions cited in code
- Documentation Style Guide - Standards for writing project documentation
Installation
From PyPI
uv add par-term-emu-core-rust
# or
pip install par-term-emu-core-rust
Wheels ship with the streaming server compiled in (StreamingServer works out of the box; check par_term_emu_core_rust._native.HAS_STREAMING to detect a build without it).
From Source
Requires Rust 1.98+ and Python 3.12+:
# Install maturin (build tool)
uv tool install maturin
# Build and install
maturin develop --release
Building a Wheel
# streaming is included: pyproject.toml [tool.maturin] features apply to every maturin build
maturin build --release
uv add --find-links target/wheels par-term-emu-core-rust
# or
pip install target/wheels/par_term_emu_core_rust-*.whl
Using as a Rust Library
The library can be used in pure Rust projects without Python. Choose your feature combination:
| Use Case | Command | What's Included |
|---|---|---|
| Rust Only | cargo add par-term-emu-core-rust --no-default-features --features pty_session |
Terminal, PTY, Macros |
| Rust + Streaming | cargo add par-term-emu-core-rust --no-default-features --features streaming,pty_session |
+ WebSocket/HTTP server |
| Python Only | cargo add par-term-emu-core-rust |
+ Python bindings |
| Everything | cargo add par-term-emu-core-rust --features full |
All features |
Note: Since v0.46.0 the
pty_sessionmodule (real PTY backend) is a separate feature. Omit it only for headless use withoutPtySession. See docs/RUST_USAGE.md for details.
Download pre-built streaming server (recommended):
Pre-built binaries and web frontend packages are available from GitHub Releases:
# Download binary (Linux example)
wget https://github.com/paulrobello/par-term-emu-core-rust/releases/latest/download/par-term-streamer-linux-x86_64
chmod +x par-term-streamer-linux-x86_64
# Download web frontend (asset named par-term-web-frontend-v<version>.tar.gz from
# https://github.com/paulrobello/par-term-emu-core-rust/releases/latest)
mkdir -p ./web_term
tar -xzf par-term-web-frontend-v*.tar.gz -C ./web_term
# Run
./par-term-streamer-linux-x86_64 --web-root ./web_term
Available binaries: Linux (x86_64, ARM64), macOS (Intel, Apple Silicon), Windows (x86_64)
Or install from crates.io:
# Streaming server (no-default-features is required: the default python feature
# links libpython and fails at link time for a standalone binary)
cargo install par-term-emu-core-rust --no-default-features --features streaming-bin --bin par-term-streamer
# Terminal multiplexer daemon + client
cargo install par-term-emu-core-rust --no-default-features --features mux-bin --bin par-mux
Or build from source:
cargo build --bin par-term-streamer --no-default-features --features streaming-bin --release
./target/release/par-term-streamer --help
See docs/RUST_USAGE.md for detailed Rust API documentation and examples.
Embedding in iOS Apps
The core ships a C API (src/ffi.rs, header include/terminal_core.h) for on-device embedding — the same emulator as par-term, packaged as a static xcframework for iOS device and simulator:
# Requires Xcode + rustup target add aarch64-apple-ios aarch64-apple-ios-sim
make xcframework
# → target/xcframework/TerminalCore.xcframework
TerminalCore.xcframework (device + simulator slices) is attached to GitHub releases from 0.56.0 on; build it locally with make xcframework for unreleased commits. Each slice carries a Modules/module.modulemap, so after adding the xcframework to an Xcode project a Swift file just does import TerminalCore (the C header is re-exported; no bridging header needed).
The C surface is a full embedding API, not just snapshots (contracts and examples in the FFI Guide):
- Version check:
ptec_terminal_abi_version— compare against the header'sTERM_CORE_ABI_VERSIONat startup - Lifecycle/input:
ptec_terminal_create/ptec_terminal_free/ptec_terminal_feed(VT bytes) /ptec_terminal_resize - Damage:
ptec_terminal_dirty_rangesreturns coalesced inclusive dirty-row ranges andptec_terminal_mark_cleanconsumes them; independent renderers useptec_terminal_damage_generation+ptec_terminal_dirty_ranges_since, so one consumer never hides damage from another - Scroll-aware damage (ABI v5):
ptec_terminal_scroll_delta_since+ptec_terminal_content_dirty_ranges_sincereport a region's net scroll plus only the content-changed rows, so a renderer blits on scroll and redraws just the new rows - Pinned readback:
ptec_terminal_read_row/ptec_terminal_read_scrollback_row/ptec_terminal_scrollback_countcopy cells into caller-owned buffers — no allocation, no full-grid copy per frame — with palette-resolved colors and default-color bits (ABI v4);ptec_terminal_read_cell_graphemereturns a cell's full grapheme cluster;ptec_terminal_scrollback_total_scrolledpairs with the count to sync a mirrored scrollback window;ptec_terminal_get_cursor/ptec_terminal_get_modescarry per-frame state - Key encoding:
ptec_terminal_encode_keyturns key events into PTY bytes (xterm legacy, kitty level-1 disambiguate, and modifyOtherKeys, honoring application cursor keys and the negotiated kitty flags);ptec_terminal_encode_key_exadds per-side macOS Option-key modes throughTermKeyOptions - Snapshots and observers:
ptec_terminal_get_state/ptec_terminal_free_state,ptec_terminal_add_observer/ptec_terminal_remove_observer; theon_event_v2slot delivers structuredTermEvents (aTERM_EVENT_*kind plus a JSON payload)
Optional Components
Terminfo Installation
For optimal terminal compatibility, install the par-term terminfo definition:
# Install for current user
./terminfo/install.sh
# Or install system-wide
sudo ./terminfo/install.sh --system
# Then use
export TERM=par-term
export COLORTERM=truecolor
See terminfo/README.md for details.
Shell Integration
Enhances terminal with semantic prompt markers, command status tracking, and smart selection:
cd shell_integration
./install.sh # Auto-detects bash/zsh/fish
See shell_integration/README.md for details.
Quick Start
Basic Terminal Emulation
from par_term_emu_core_rust import Terminal
# Create terminal
term = Terminal(80, 24)
# Process ANSI sequences
term.process_str("Hello, \x1b[31mWorld\x1b[0m!\n")
term.process_str("\x1b[1;32mBold green text\x1b[0m\n")
# Get content and cursor position
print(term.content())
col, row = term.cursor_position()
print(f"Cursor at: ({col}, {row})")
PTY (Interactive Shell)
from par_term_emu_core_rust import PtyTerminal
# Create PTY terminal and spawn shell
with PtyTerminal(80, 24) as term:
term.spawn_shell()
# Send commands
term.write_str("echo 'Hello from shell!'\n")
# Block until the output actually lands — no sleep guessing
term.wait_for_text("Hello from shell!", timeout=3.0)
# Get output
print(term.content())
# Resize terminal
term.resize(100, 30)
# Exit shell
term.write_str("exit\n")
# Automatic cleanup
Environment Variables and Working Directory
Pass environment variables and working directory directly to spawn_shell() without modifying
the parent process environment. This is safe for multi-threaded applications (e.g., Tokio):
from par_term_emu_core_rust import PtyTerminal
# Spawn with custom environment variables
with PtyTerminal(80, 24) as term:
term.spawn_shell(env={"MY_VAR": "hello", "DEBUG": "1"})
term.write_str("echo $MY_VAR\n") # Outputs: hello
# Spawn with custom working directory
with PtyTerminal(80, 24) as term:
term.spawn_shell(cwd="/tmp")
term.write_str("pwd\n") # Outputs: /tmp
# Combine both
with PtyTerminal(80, 24) as term:
term.spawn_shell(env={"PROJECT": "myapp"}, cwd="/home/user/projects")
The spawn() method also accepts env and cwd parameters:
term.spawn("/bin/bash", ["-c", "echo $MY_VAR"], env={"MY_VAR": "test"}, cwd="/tmp")
Screenshots
term = Terminal(80, 24)
term.process_str("\x1b[1;31mHello, World!\x1b[0m\n")
# Save screenshot
term.screenshot_to_file("output.png")
term.screenshot_to_file("output.svg", format="svg") # Vector graphics!
open("output.html", "w").write(term.export_html(include_styles=True)) # Styled HTML
# Custom configuration
term.screenshot_to_file(
"output.png",
font_size=16.0,
padding=20,
include_scrollback=True,
minimum_contrast=0.5, # iTerm2-compatible contrast adjustment
)
Color Utilities
from par_term_emu_core_rust import (
perceived_brightness_rgb,
adjust_contrast_rgb,
contrast_ratio,
meets_wcag_aa,
rgb_to_hex,
hex_to_rgb,
mix_colors,
)
# iTerm2-compatible contrast adjustment
adjusted = adjust_contrast_rgb((64, 64, 64), (0, 0, 0), 0.5)
# WCAG accessibility checks
ratio = contrast_ratio((0, 0, 0), (255, 255, 255))
print(f"Contrast ratio: {ratio:.1f}:1")
print(f"Meets WCAG AA: {meets_wcag_aa((0, 0, 0), (255, 255, 255))}")
# Color conversions
hex_color = rgb_to_hex((255, 128, 64)) # "#FF8040"
rgb = hex_to_rgb("#FF8040") # (255, 128, 64)
mixed = mix_colors((255, 0, 0), (0, 0, 255), 0.5) # Purple
Macro Recording and Playback
from par_term_emu_core_rust import Macro, PtyTerminal
import time
# Create a macro manually
macro = Macro("git_status")
macro.set_description("Check git status and show branch")
macro.add_key("g")
macro.add_key("i")
macro.add_key("t")
macro.add_key("space")
macro.add_key("s")
macro.add_key("t")
macro.add_key("a")
macro.add_key("t")
macro.add_key("u")
macro.add_key("s")
macro.add_key("enter")
macro.add_delay(500) # Wait 500ms
macro.add_screenshot("git_status.png") # Trigger screenshot
# Save to YAML
macro.save_yaml("git_status.yaml")
# Load and play back
term = PtyTerminal(80, 24)
term.spawn_shell()
# Load macro from file
loaded_macro = Macro.load_yaml("git_status.yaml")
term.load_macro("git_check", loaded_macro)
# Play the macro
term.play_macro("git_check", speed=1.0) # Normal speed
# Tick to execute macro events
while term.is_macro_playing():
if term.tick_macro(): # Returns True if event was processed
time.sleep(0.01) # Small delay for visual effect
# Check for screenshot triggers
triggers = term.get_macro_screenshot_triggers()
for label in triggers:
term.screenshot_to_file(label)
# Convert a recording to a macro
term.start_recording("test session")
term.write_str("ls -la\n")
time.sleep(0.5)
session = term.stop_recording()
# Convert and save
macro = term.recording_to_macro(session, "ls_command")
macro.save_yaml("ls_command.yaml")
Examples
See the examples/ directory for comprehensive examples:
Basic Examples
basic_usage_improved.py- Enhanced basic usagecolors_demo.py- Color supportcursor_movement.py- Cursor controltext_attributes.py- Text stylingunicode_emoji.py- Unicode/emoji supportscrollback_demo.py- Scrollback buffer usage
Advanced Features
alt_screen.py- Alternate screen buffermouse_tracking.py- Mouse eventsbracketed_paste.py- Bracketed pastesynchronized_updates.py- Flicker-free renderingshell_integration.py- OSC 133 integrationtest_osc52_clipboard.py- SSH clipboardtest_kitty_keyboard.py- Kitty keyboard protocolhyperlink_demo.py- Clickable URLsnotifications.py- Desktop notificationsrectangle_operations.py- VT420 rectangle ops
Graphics and Export
display_image_sixel.py- Sixel graphicstest_sixel_simple.py- Simple sixel examplestest_sixel_display.py- Advanced sixel displayscreenshot_demo.py- Screenshot featuresfeature_showcase.py- Comprehensive TUI showcase
PTY Examples
pty_basic.py- Basic PTY usagepty_shell.py- Interactive shellspty_resize.py- Dynamic resizingpty_event_loop.py- Event loop integrationpty_mouse_events.py- Mouse in PTYpty_custom_env.py- Custom environment variablespty_multiple.py- Multiple PTY sessionspty_with_par_term.py- Integration with par-term
Terminal Streaming
streaming_demo.py- Python WebSocket streaming serverstreaming_client.html- Browser-based terminal client
Macros and Automation
demo.yaml- Example macro definition
Standalone Rust Server:
# Build and run (default: ws://127.0.0.1:8099)
make streamer-run
# Run with authentication
make streamer-run-auth
# Or use cargo directly
cargo build --bin par-term-streamer --no-default-features --features streaming-bin --release
./target/release/par-term-streamer --port 8099 --theme dracula
# With authentication
./target/release/par-term-streamer --api-key my-secret --theme monokai
# With system resource stats (CPU, memory, disk, network)
./target/release/par-term-streamer --enable-system-stats --system-stats-interval 5
# Install globally
make streamer-install
par-term-streamer --help
Available Themes: iterm2-dark, monokai, dracula, solarized-dark
Diagnostics and Test Scripts
bce_scroll_test.py- Background color erase (BCE) during scrollingchar_test.py- Character-specific rendering testgradient_test.py- Minimal gradient test for terminal wrap behaviorrich_mimic_test.py- Rich-style output rendering testscroll_timing_test.py- Scroll timing teststreaming_debug.py- Streaming server debug tooltest_tui_clipboard.py- TUI clipboard and selection featurestest_underline_styles.py- Underline styles (SGR 4:x)render_utils.py- Rendering helpers imported by the other examples (not run directly)
Web Terminal Frontend
Using Pre-built Package (Recommended):
Download the pre-built static web frontend from GitHub Releases:
# Download and extract (asset named par-term-web-frontend-v<version>.tar.gz from
# https://github.com/paulrobello/par-term-emu-core-rust/releases/latest)
mkdir -p ./web_term
tar -xzf par-term-web-frontend-v*.tar.gz -C ./web_term
# Run streamer with web frontend
par-term-streamer --web-root ./web_term
# Open browser to http://localhost:8099
See web-terminal-frontend/README.md for detailed usage instructions.
Building from Source:
A modern Next.js-based web terminal frontend source is in web-terminal-frontend/:
# Install dependencies (bun)
make web-install
# Development server on http://localhost:3000
make web-dev
# Static build copied to web_term/ for par-term-streamer --web-root
make web-build-static
Features:
- Modern UI with Tailwind CSS v4
- xterm.js terminal emulator
- WebSocket connection to streaming server
- Theme selection and synchronization
- Responsive design
- Terminal resize support
- Customizable UI theme - Edit
theme.cssafter build (no rebuild required)
See web-terminal-frontend/README.md for detailed setup and configuration.
TUI Demo Application
A full-featured TUI (Text User Interface) application is available in the sister project par-term-emu-tui-rust.
Installation: uv add par-term-emu-tui-rust or pip install par-term-emu-tui-rust
GitHub: https://github.com/paulrobello/par-term-emu-tui-rust
Technology
- Rust (1.98+) - Core library implementation
- Python (3.12+) - Python bindings
- PyO3 - Zero-cost Python/Rust bindings
- VTE - ANSI sequence parsing
- portable-pty - Cross-platform PTY support
Running Tests
# All tests: Rust, Rust streaming, and Python (rebuilds the extension first)
make test
# Rust tests only (plain `cargo test` fails to link under the default `python` feature)
make test-rust
# Python tests only (runs `make dev` first)
make test-python
Performance
- Zero-copy operations where possible
- Efficient grid representation
- Fast ANSI parsing with VTE crate
- Minimal Python/Rust boundary crossings
See docs/ARCHITECTURE.md for implementation details.
Security
When using PTY functionality, follow security best practices to prevent command injection and other vulnerabilities.
See docs/SECURITY.md for comprehensive security guidelines.
Contributing
Contributions are welcome! Please submit issues or pull requests on GitHub.
Development Setup
git clone https://github.com/paulrobello/par-term-emu-core-rust.git
cd par-term-emu-core-rust
make setup-venv # Create virtual environment
make pre-commit-install # Install pre-commit hooks (recommended)
make dev # Build library
make checkall # Run all quality checks
Code Quality
All contributions must pass:
- Rust formatting (
cargo fmt) - Rust linting (
cargo clippy) - Python formatting (
make fmt-python) - Python linting (
make lint-python) - Type checking (
pyright) - Tests (
make test-python)
TIP: Use make pre-commit-install to automate all checks on every commit!
See CONTRIBUTING.md for the contribution workflow, and CLAUDE.md for detailed development instructions.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Paul Robello - probello@gmail.com
Links
- PyPI: https://pypi.org/project/par-term-emu-core-rust/
- Crates.io: https://crates.io/crates/par-term-emu-core-rust
- GitHub: https://github.com/paulrobello/par-term-emu-core-rust
- TUI Application: https://github.com/paulrobello/par-term-emu-tui-rust
- Documentation: See docs/ directory
- Examples: See examples/ directory
Metadata
Release files for par-term-emu-core-rust 0.58.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| par_term_emu_core_rust-0.58.0.tar.gz | 2.1 MB | Details |
Built distributions (wheels)
Total release size: 112.4 MB
Release files / par_term_emu_core_rust-0.58.0.tar.gz
| Download URL | par_term_emu_core_rust-0.58.0.tar.gz |
|---|---|
| Size | 2.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
438ab2e30f519ddde326242e3ad42c6774b313d57f1c752f8de1f0000be85e4f
|
|
BLAKE2b-256 checksum How to use checksums |
153c6a170f634454a1f2b59ebdb76dfc203c5eb6902b89558642bb09fd7216b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / par_term_emu_core_rust-0.58.0-cp314-cp314-win_amd64.whl
| Download URL | par_term_emu_core_rust-0.58.0-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 6.2 MB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8b43f8093f60912ae4fb009ad9e59ccfcd9709499fa186d59b3d6863d67762d3
|
|
BLAKE2b-256 checksum How to use checksums |
3918df94d78d767d0cb16cc7c21dfb9dfa3d5c296982d820e38a70c293de9d6f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / par_term_emu_core_rust-0.58.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | par_term_emu_core_rust-0.58.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 6.4 MB |
| Tags | CPython 3.14 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
0c566ba501a0a1733e27ad882058bd72cae0b8651ab229988b796828b4f92f2e
|
|
BLAKE2b-256 checksum How to use checksums |
a30b8ba0315b23958cd799d0caf2b080ae929f78487086f5ae9499386a958bc7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / par_term_emu_core_rust-0.58.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | par_term_emu_core_rust-0.58.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 6.0 MB |
| Tags | CPython 3.14 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
41b17315ff8bf3826e0bfb24025e70e06132cd52f347a7c8c020eaa2ac746c10
|
|
BLAKE2b-256 checksum How to use checksums |
d39d132e3d7c406019d8d7b1637957790bacd9e531873d9b8a78db70609ad8ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / par_term_emu_core_rust-0.58.0-cp314-cp314-macosx_10_12_x86_64.whl
| Download URL | par_term_emu_core_rust-0.58.0-cp314-cp314-macosx_10_12_x86_64.whl |
|---|---|
| Size | 6.2 MB |
| Tags | CPython 3.14 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
a4e29f69979c15f8a6ac0e9b7d46a11ba8e118c7e372340af338db5f43386d02
|
|
BLAKE2b-256 checksum How to use checksums |
6bed468e7b07c4c05d0a33c34bf5b4c867d08e50d9dbc3395bc22804bd9e029f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / par_term_emu_core_rust-0.58.0-cp314-cp314-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
| Download URL | par_term_emu_core_rust-0.58.0-cp314-cp314-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
|---|---|
| Size | 11.9 MB |
| Tags | CPython 3.14 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
549839d3195aef1b858d44d9ed5abd299893d55c476f88ce60daec4e21fc0490
|
|
BLAKE2b-256 checksum How to use checksums |
1986ffba3ce54d830d9ead452859bc5a6395b1f421e948d33cc8f3532be92f9a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / par_term_emu_core_rust-0.58.0-cp313-cp313-win_amd64.whl
| Download URL | par_term_emu_core_rust-0.58.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 6.2 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
cec7ff66f047ed7ec6d6bad29bc7a31c4e63928ceaf9422e506339807f1112aa
|
|
BLAKE2b-256 checksum How to use checksums |
a22312db23ad472796e0cb9f6ddef6deab29fdd32d3dfaa7d1ebbf7f5c4d29b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / par_term_emu_core_rust-0.58.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | par_term_emu_core_rust-0.58.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 6.4 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
6ce69d70df699caab493510575489680f82b292b6df24a2bacbd7f87c68baa14
|
|
BLAKE2b-256 checksum How to use checksums |
07547850673e172772ec902e44b9f802ee078a5b63b4a90d055cc2fd0c4739b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / par_term_emu_core_rust-0.58.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | par_term_emu_core_rust-0.58.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 6.0 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
30543ad5d532fa171ef731436f6206df96a2a60fe3ec24255bcdeff58d272b40
|
|
BLAKE2b-256 checksum How to use checksums |
eb566edf80f16545a7688d6f183a7eb08ba2d6760c42343da241e49b29f58cab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / par_term_emu_core_rust-0.58.0-cp313-cp313-macosx_10_12_x86_64.whl
| Download URL | par_term_emu_core_rust-0.58.0-cp313-cp313-macosx_10_12_x86_64.whl |
|---|---|
| Size | 6.2 MB |
| Tags | CPython 3.13 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
244795aa921cef5a752a0a044d295ecfe3b6130e88cd6e7535c9c8ca72ef6be2
|
|
BLAKE2b-256 checksum How to use checksums |
06ed7e16b23e7b57e992357311509b55ed2273a4d54ae0c404652d4fda906496
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / par_term_emu_core_rust-0.58.0-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
| Download URL | par_term_emu_core_rust-0.58.0-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
|---|---|
| Size | 11.9 MB |
| Tags | CPython 3.13 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ea2b92f81a47ff4191cd10f2dab4e755c396c994b143eebdaf0e28c6a65b1d80
|
|
BLAKE2b-256 checksum How to use checksums |
5a7ddb5a1d81b0402b72351431018b4ad364f36e684244e8f184ba64c8588294
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / par_term_emu_core_rust-0.58.0-cp312-cp312-win_amd64.whl
| Download URL | par_term_emu_core_rust-0.58.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 6.2 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
17ba4b4a189562b25c2b899b06acb6b27829a56ec47f8e8e2239afb37c8c36d9
|
|
BLAKE2b-256 checksum How to use checksums |
44e6c5e656bfe7e94ee8ca0b1f35bb7b58553dcc9c8394d6b07439931a2e1541
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / par_term_emu_core_rust-0.58.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | par_term_emu_core_rust-0.58.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 6.4 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
2d94715b709343735365ddd93941f9b8e4c641f19beda450b42e9213f92d1081
|
|
BLAKE2b-256 checksum How to use checksums |
025011d0bca4957ef235d77bc31f08c29f89a21792d986e6f2127f2e51592750
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / par_term_emu_core_rust-0.58.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | par_term_emu_core_rust-0.58.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 6.0 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
b7a2c0c3cadf3589e10bae8f8c038c9a5e3b721e4279d2b8cfa4007e2c8a64a6
|
|
BLAKE2b-256 checksum How to use checksums |
1bbef296a228e042e56797ab12380c3e99eb06e6f497302eb596a241f4c26669
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / par_term_emu_core_rust-0.58.0-cp312-cp312-macosx_10_12_x86_64.whl
| Download URL | par_term_emu_core_rust-0.58.0-cp312-cp312-macosx_10_12_x86_64.whl |
|---|---|
| Size | 6.2 MB |
| Tags | CPython 3.12 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
8a86bc87fc9fb9c6aa2ba43bc2a59a1393d245089773497a4fd033cf213cc569
|
|
BLAKE2b-256 checksum How to use checksums |
cc089de1f6b20249b7a4c8649798cf269eed01c0eb2ede76ac233a3115655175
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / par_term_emu_core_rust-0.58.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
| Download URL | par_term_emu_core_rust-0.58.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
|---|---|
| Size | 11.9 MB |
| Tags | CPython 3.12 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ec9ea7dcca8845646a80c0174807bdaf652c6a32d0eec749d879cde3fcbae144
|
|
BLAKE2b-256 checksum How to use checksums |
3086bda574212d26b231f950aa5872cd6f569609dd8d5d8378914a6a0d066719
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency log