Skip to main content

A comprehensive terminal emulator library in Rust with Python bindings - supports true color, alt screen, mouse reporting, bracketed paste, and full Unicode

Project description

Par Term Emu Core Rust

PyPI Crates.io PyPI - Python Version Runs on Linux | MacOS | Windows Arch x86-64 | ARM | AppleSilicon PyPI - Downloads Crates.io Downloads PyPI - License

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.

"Buy Me A Coffee"

What's New in 0.17.0

🎉 New Features

  • Web Terminal Macro System: New macro tab in the on-screen keyboard for creating and playing terminal command macros

    • Create named macros with multi-line scripts (one command per line)
    • Quick select buttons to run macros with a single tap
    • Playback with 200ms delay before each Enter key for reliable command execution
    • Edit and delete existing macros via hover menu
    • Stop button to abort macro playback mid-execution
    • Macros persist to localStorage across sessions
    • Visual feedback during playback (pulsing animation, stop button)
    • Option to disable sending Enter after each line (for text insertion macros)
    • Template commands for advanced scripting: [[delay:N]], [[enter]], [[tab]], [[esc]], [[space]], [[ctrl+X]], [[shift+X]], [[ctrl+shift+X]], [[shift+tab]], [[shift+enter]]
  • On-Screen Keyboard Enhancements:

    • Permanent symbols grid on the right side with all keyboard symbols (32 keys)
    • Added Space, Enter, http://, and https:// buttons to modifier row
    • Added tooltips to Ctrl shortcut buttons
    • Expanded symbol keys with full punctuation set

🔧 Improvements

  • On-Screen Keyboard Layout: Reorganized for better usability with more compact vertical layout and persistent symbols grid

📦 Dependency Updates

  • Web Frontend: Updated @types/node (25.0.1 → 25.0.2)

What's New in 0.16.3

🐛 Bug Fixes

  • Web Terminal tmux/TUI Fix: Fixed control characters (^[[?1;2c^[[>0;276;0c) appearing when running tmux or other TUI applications in the web terminal. The issue was caused by xterm.js generating Device Attributes responses when the backend terminal emulator already handles these queries.

🚀 Performance Optimizations

  • jemalloc Allocator: New optional jemalloc feature for 5-15% server throughput improvement (non-Windows only)
  • TCP_NODELAY: Disabled Nagle's algorithm for lower keystroke latency (up to 40ms improvement)
  • Output Batching: Time-based batching at 60fps reduces WebSocket overhead by 50-80% during burst output
  • Compression Threshold: Lowered to 256 bytes to compress more typical terminal output
  • WebSocket Preconnect: Reduces initial connection latency by 100-200ms
  • Font Preloading: Eliminates layout shift and font flash

📦 Dependency Updates

  • Web Frontend: Updated Next.js and type definitions
  • Pre-commit Hooks: Updated ruff linter

What's New in 0.16.2

🔧 Compatibility Fix

  • TERM Environment Variable: Changed default TERM from xterm-kitty to xterm-256color for better compatibility with systems lacking kitty terminfo

What's New in 0.16.0

🔒 TLS/SSL Support

  • Secure WebSocket Connections for production deployments:
    • New CLI options: --tls-cert, --tls-key, --tls-pem
    • Supports separate cert/key files or combined PEM
    • Enables HTTPS and WSS (secure WebSocket)
# Using separate cert and key files
par-term-streamer --enable-http --tls-cert cert.pem --tls-key key.pem

# Using combined PEM file
par-term-streamer --enable-http --tls-pem combined.pem

🚀 Performance: Binary Protocol

  • BREAKING: Protocol Buffers for WebSocket Streaming:
    • Replaced JSON with binary Protocol Buffers encoding
    • ~80% smaller messages for typical terminal output
    • Optional zlib compression for large payloads (screen snapshots)
    • Wire format: 1-byte header + protobuf payload

🐍 Python Bindings

  • TLS Configuration: StreamingConfig methods for TLS setup
  • Binary Protocol Functions: encode_server_message(), decode_server_message(), encode_client_message(), decode_client_message()

See CHANGELOG.md for complete version history.

What's New in 0.15.0

🎉 New Features

  • Streaming Server CLI Enhancements:
    • --download-frontend option to download prebuilt web frontend from GitHub releases
    • --frontend-version option to specify version to download (default: "latest")
    • --use-tty-size option to use current terminal size from TTY
    • No longer requires Node.js/npm to use web frontend - can download prebuilt version

Quick Start

# Build the streaming server
make streamer-build-release

# Download prebuilt web frontend (no Node.js required!)
./target/release/par-term-streamer --download-frontend

# Run server with frontend
./target/release/par-term-streamer --enable-http

# Open browser to http://127.0.0.1:8099

What's New in 0.14.0

🎉 New Features

  • Web Terminal Onscreen Keyboard: Mobile-friendly virtual keyboard for touch devices

    • Special keys missing from iOS/Android keyboards: Esc, Tab, arrow keys, Page Up/Down, Home, End, Insert, Delete
    • Function keys F1-F12 (toggleable), symbol keys (|, , `, ~, {, }, etc.)
    • Modifier keys (Ctrl, Alt, Shift) that combine with other keys
    • Quick Ctrl shortcuts: ^C, ^D, ^Z, ^L, ^A, ^E, ^K, ^U, ^W, ^R
    • Glass morphism design, haptic feedback, auto-shows on mobile
  • OSC 9;4 Progress Bar Support (ConEmu/Windows Terminal style):

    • Terminal applications can report progress that can be displayed in tab bars, taskbars, or window titles

What's New in 0.13.0

🎉 New Features

  • Streaming Server Enhancements:

    • --size CLI option for specifying terminal size in COLSxROWS format (e.g., --size 120x40 or -s 120x40)
    • --command / -c CLI option to execute a command after shell startup (with 1 second delay for prompt settling)
    • initial_cols and initial_rows configuration options in StreamingConfig for both Rust and Python APIs
  • Python Bindings Enhancements:

    • New MouseEncoding enum for mouse event encoding control (Default, Utf8, Sgr, Urxvt)
    • Direct screen buffer control: use_alt_screen(), use_primary_screen()
    • Mouse encoding control: mouse_encoding(), set_mouse_encoding()
    • Mode setters: set_focus_tracking(), set_bracketed_paste(), set_title()
    • Bold brightening control: bold_brightening(), set_bold_brightening()
    • Color getters for all theme colors (link, bold, cursor guide, badge, match, selection)

What's New in 0.12.0

🐛 Bug Fixes

  • Terminal Reflow Improvements: Multiple fixes to scrollback and grid reflow behavior during resize

What's New in 0.11.0

🎉 New Features

  • Full Terminal Reflow on Width Resize: Both scrollback AND visible screen content now reflow when terminal width changes
    • Previously, width changes cleared scrollback and clipped visible content
    • Now implements intelligent reflow similar to xterm and iTerm2:
      • Scrollback: Preserves all history with proper line wrapping/unwrapping
      • Visible Screen: Content wraps instead of being clipped when narrowing
      • Width increase: Unwraps soft-wrapped lines into longer lines
      • Width decrease: Re-wraps lines that no longer fit
    • Preserves all cell attributes (colors, bold, italic, etc.)
    • Handles wide characters (CJK, emoji) correctly at line boundaries
    • Significant UX improvement for terminal resize operations

What's New in 0.10.0

🎉 New Features

  • Emoji Sequence Preservation: Complete support for complex emoji sequences and grapheme clusters

    • ⚠️ vs ⚠ - Variation selectors (emoji vs text style)
    • 👋🏽 - Skin tone modifiers (Fitzpatrick scale)
    • 👨‍👩‍👧‍👦 - ZWJ sequences (family emoji)
    • 🇺🇸 🇬🇧 - Regional indicator flags
    • é - Combining diacritics and marks
    • New grapheme module for Unicode cluster detection
    • Enhanced Python bindings export full grapheme clusters
  • Web Terminal Frontend: Modern Next.js-based web interface

    • Built with Next.js, TypeScript, and Tailwind CSS v4
    • Theme support with configurable color palettes
    • Nerd Font support for file/folder icons
    • New Makefile targets for web frontend development
  • Terminal Sequence Support:

    • CSI 3J - Clear scrollback buffer command
    • Improved cursor positioning for snapshot exports

🐛 Bug Fixes

  • Graphics now properly preserved when scrolling into scrollback buffer
  • Sixel content saved to scrollback during large scrolling operations
  • Kitty Graphics Protocol animation parsing fixes (base64 encoding, frame actions)

⚠️ Breaking Changes (Rust API only)

  • Cell struct no longer implements Copy (now Clone only)
    • Required for variable-length grapheme cluster storage
    • All cell copy operations now require explicit .clone() calls
    • Python bindings are unaffected - no changes needed in Python code
    • Performance impact is minimal due to efficient cloning

What's New in 0.9.1

  • Theme Rendering Fix: Fixed theme color palette application in Python bindings

What's New in 0.9.0

  • Graphics Protocol Support: Comprehensive multi-protocol graphics implementation

    • iTerm2 Inline Images (OSC 1337): PNG, JPEG, GIF support with base64 encoding
    • Kitty Graphics Protocol (APC G): Advanced image placement with reuse and animations
    • Sixel Graphics: Enhanced with unique IDs and configurable cell dimensions
    • Unified GraphicsStore with scrollback support and memory limits
    • Animation support with frame composition and timing control
    • Graphics dropped event tracking for resource management
  • Pre-built Streaming Server Binaries: Download ready-to-run binaries from GitHub Releases

    • Linux (x86_64, ARM64), macOS (Intel, Apple Silicon), Windows (x86_64)
    • No compilation needed - just download and run
    • Includes separate web frontend package (tar.gz/zip) for serving the terminal interface
    • Published to crates.io for Rust developers: cargo install par-term-emu-core-rust --features streaming

See CHANGELOG.md for complete version history.

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 Notifications - Desktop-style alerts and notifications
  • Shell Integration - OSC 133 (iTerm2/VSCode compatible)
  • 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

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, and advanced placement
  • 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

Screenshots and Export

  • Multiple Formats - PNG, JPEG, BMP, SVG (vector), 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

Installation

From PyPI

uv add par-term-emu-core-rust
# or
pip install par-term-emu-core-rust

From Source

Requires Rust 1.75+ and Python 3.12+:

# Install maturin (build tool)
uv tool install maturin

# Build and install
maturin develop --release

Building a Wheel

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 Cargo.toml What's Included
Rust Only par-term-emu-core-rust = { version = "0.10", default-features = false } Terminal, PTY, Macros
Rust + Streaming par-term-emu-core-rust = { version = "0.10", default-features = false, features = ["streaming"] } + WebSocket/HTTP server
Python Only par-term-emu-core-rust = "0.10" + Python bindings
Everything par-term-emu-core-rust = { version = "0.10", features = ["full"] } All features

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
wget https://github.com/paulrobello/par-term-emu-core-rust/releases/latest/download/par-term-web-frontend-v0.10.0.tar.gz
tar -xzf par-term-web-frontend-v0.10.0.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:

cargo install par-term-emu-core-rust --features streaming

Or build from source:

cargo build --bin par-term-streamer --no-default-features --features streaming --release
./target/release/par-term-streamer --help

See docs/RUST_USAGE.md for detailed Rust API documentation and examples.

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
import time

# 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")
    time.sleep(0.2)

    # Get output
    print(term.content())

    # Resize terminal
    term.resize(100, 30)

    # Exit shell
    term.write_str("exit\n")
# Automatic cleanup

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!
term.screenshot_to_file("output.html", format="html")  # 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 usage
  • colors_demo.py - Color support
  • cursor_movement.py - Cursor control
  • text_attributes.py - Text styling
  • unicode_emoji.py - Unicode/emoji support
  • scrollback_demo.py - Scrollback buffer usage

Advanced Features

  • alt_screen.py - Alternate screen buffer
  • mouse_tracking.py - Mouse events
  • bracketed_paste.py - Bracketed paste
  • synchronized_updates.py - Flicker-free rendering
  • shell_integration.py - OSC 133 integration
  • test_osc52_clipboard.py - SSH clipboard
  • test_kitty_keyboard.py - Kitty keyboard protocol
  • hyperlink_demo.py - Clickable URLs
  • notifications.py - Desktop notifications
  • rectangle_operations.py - VT420 rectangle ops

Graphics and Export

  • display_image_sixel.py - Sixel graphics
  • test_sixel_simple.py - Simple sixel examples
  • test_sixel_display.py - Advanced sixel display
  • screenshot_demo.py - Screenshot features
  • feature_showcase.py - Comprehensive TUI showcase

PTY Examples

  • pty_basic.py - Basic PTY usage
  • pty_shell.py - Interactive shells
  • pty_resize.py - Dynamic resizing
  • pty_event_loop.py - Event loop integration
  • pty_mouse_events.py - Mouse in PTY
  • pty_custom_env.py - Custom environment variables
  • pty_multiple.py - Multiple PTY sessions
  • pty_with_par_term.py - Integration with par-term

Terminal Streaming

  • streaming_demo.py - Python WebSocket streaming server
  • streaming_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:8080)
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 --release
./target/release/par-term-streamer --port 8080 --theme dracula

# With authentication
./target/release/par-term-streamer --api-key my-secret --theme monokai

# Install globally
make streamer-install
par-term-streamer --help

Available Themes: iterm2-dark, monokai, dracula, solarized-dark

Web Terminal Frontend

Using Pre-built Package (Recommended):

Download the pre-built static web frontend from GitHub Releases:

# Download and extract
wget https://github.com/paulrobello/par-term-emu-core-rust/releases/latest/download/par-term-web-frontend-v0.10.0.tar.gz
tar -xzf par-term-web-frontend-v0.10.0.tar.gz -C ./web_term

# Run streamer with web frontend
par-term-streamer --web-root ./web_term
# Open browser to http://localhost:8080

See web_term/README.md for detailed usage instructions.

Building from Source:

A modern Next.js-based web terminal frontend source is in web-terminal-frontend/:

cd web-terminal-frontend

# Install dependencies
npm install

# Development server (runs on port 8030)
npm run dev

# Build for production (outputs to out/)
npm run build

# Copy to web_term for serving
cp -r out/* ../web_term/

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

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.

TUI Demo Application

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.75+) - 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

# Run Rust tests
cargo test

# Run Python tests
uv sync  # Install dependencies including pytest
pytest tests/

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 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

par_term_emu_core_rust-0.17.0.tar.gz (1.3 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

par_term_emu_core_rust-0.17.0-cp314-cp314-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.14Windows x86-64

par_term_emu_core_rust-0.17.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

par_term_emu_core_rust-0.17.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.3 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ ARM64

par_term_emu_core_rust-0.17.0-cp314-cp314-macosx_10_12_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

par_term_emu_core_rust-0.17.0-cp314-cp314-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (6.6 MB view details)

Uploaded CPython 3.14macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

par_term_emu_core_rust-0.17.0-cp313-cp313-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.13Windows x86-64

par_term_emu_core_rust-0.17.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

par_term_emu_core_rust-0.17.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

par_term_emu_core_rust-0.17.0-cp313-cp313-macosx_10_12_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

par_term_emu_core_rust-0.17.0-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (6.6 MB view details)

Uploaded CPython 3.13macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

par_term_emu_core_rust-0.17.0-cp312-cp312-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.12Windows x86-64

par_term_emu_core_rust-0.17.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

par_term_emu_core_rust-0.17.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

par_term_emu_core_rust-0.17.0-cp312-cp312-macosx_10_12_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

par_term_emu_core_rust-0.17.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (6.6 MB view details)

Uploaded CPython 3.12macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file par_term_emu_core_rust-0.17.0.tar.gz.

File metadata

  • Download URL: par_term_emu_core_rust-0.17.0.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for par_term_emu_core_rust-0.17.0.tar.gz
Algorithm Hash digest
SHA256 4ca846a7061d44b30387faf9be97d0f12db3f28f734ab4536fe126599d3269bc
MD5 190df579b583a5527aecb678270ef2b7
BLAKE2b-256 097dab9ca703494b0bc40a3213ea1bbea6b4ac78f659910cda5bc3927cff3e68

See more details on using hashes here.

Provenance

The following attestation bundles were made for par_term_emu_core_rust-0.17.0.tar.gz:

Publisher: deployment.yml on paulrobello/par-term-emu-core-rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file par_term_emu_core_rust-0.17.0-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for par_term_emu_core_rust-0.17.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 9e49e785ab1305c845ac98b655eaeb6c9b652b27302a5a605e0acef3791c7796
MD5 cc025ff1bf8f6e915ba197744b533f5c
BLAKE2b-256 21ab998c7f74f28d440332a80e0d90a8cb39978cf5df7276878a004ad40d7899

See more details on using hashes here.

Provenance

The following attestation bundles were made for par_term_emu_core_rust-0.17.0-cp314-cp314-win_amd64.whl:

Publisher: deployment.yml on paulrobello/par-term-emu-core-rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file par_term_emu_core_rust-0.17.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for par_term_emu_core_rust-0.17.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9035c20684b7a139cd827f19e0f9ceed80b351e2bfa573ad8000836063022306
MD5 0199c19c96b2326f41f1b5f3ac4d4f72
BLAKE2b-256 e133581a5590600edfa1af26c8f993756dbdeddfaecf530fe56d06b129e9428d

See more details on using hashes here.

Provenance

The following attestation bundles were made for par_term_emu_core_rust-0.17.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: deployment.yml on paulrobello/par-term-emu-core-rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file par_term_emu_core_rust-0.17.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for par_term_emu_core_rust-0.17.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 79663f45d719d1eabf8711210f3b2a523d6dd6f256f5db67d1c68ec49a2ddf86
MD5 556f03cbb269cf7b34a229ac7b7db7c3
BLAKE2b-256 70a00dbb260e252cb451490267cea9976d12e1df251ecfc10d1da8ce1726ab79

See more details on using hashes here.

Provenance

The following attestation bundles were made for par_term_emu_core_rust-0.17.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: deployment.yml on paulrobello/par-term-emu-core-rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file par_term_emu_core_rust-0.17.0-cp314-cp314-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for par_term_emu_core_rust-0.17.0-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 11fb0c6bc81e1361edcfa15dc76f68e2d3716e68f33604c2487e3c031f26c5fe
MD5 7a3f39cba8a635c9d0ddea291eb4c470
BLAKE2b-256 05e3012b397ec035aa11a3cac773830166152b59e742a2dddd54758c3137ffb5

See more details on using hashes here.

Provenance

The following attestation bundles were made for par_term_emu_core_rust-0.17.0-cp314-cp314-macosx_10_12_x86_64.whl:

Publisher: deployment.yml on paulrobello/par-term-emu-core-rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file par_term_emu_core_rust-0.17.0-cp314-cp314-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for par_term_emu_core_rust-0.17.0-cp314-cp314-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 ff7badcb3a130b4ecdece2248dbb9e2ea33fb8ffa14331e7018f770068643853
MD5 fc84718a8709756e63563778173bef03
BLAKE2b-256 e8d4cb65d87a3e1a6b99a2a39f692f727f37fecdc34d2b129bce8d9d99a5c3fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for par_term_emu_core_rust-0.17.0-cp314-cp314-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: deployment.yml on paulrobello/par-term-emu-core-rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file par_term_emu_core_rust-0.17.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for par_term_emu_core_rust-0.17.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 9bae09d11567b9f350ae21d04a41cf2279dce85ce5488e0d7a74325b8e878028
MD5 6515f8cc48458d730dca85b23fea4c5b
BLAKE2b-256 6c903cb3a39790cdf041821b3bc1cc3382a2ea2a44420121bcbfa25186572ee5

See more details on using hashes here.

Provenance

The following attestation bundles were made for par_term_emu_core_rust-0.17.0-cp313-cp313-win_amd64.whl:

Publisher: deployment.yml on paulrobello/par-term-emu-core-rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file par_term_emu_core_rust-0.17.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for par_term_emu_core_rust-0.17.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1511863fb5ca64c2f37df349956ed85cdb420301b6ef9da5c82a64c37b4cd15e
MD5 1e79db6ed2df102f72b81a8f31f6734a
BLAKE2b-256 df91c82db0cd09fe8150ea1647b048b884d673de54a4c01f24311da1575aaba0

See more details on using hashes here.

Provenance

The following attestation bundles were made for par_term_emu_core_rust-0.17.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: deployment.yml on paulrobello/par-term-emu-core-rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file par_term_emu_core_rust-0.17.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for par_term_emu_core_rust-0.17.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f2cff3289af577e3c688d8a0698c2c682f1c99f1f644c7dcfd505dc11e9b13e7
MD5 b0dc0a03b50309fff51782bb5a9f3c41
BLAKE2b-256 ec8afbb7949a13bfe1b2323b8fcd61ae3915eb246ec4348fefe177854cea01e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for par_term_emu_core_rust-0.17.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: deployment.yml on paulrobello/par-term-emu-core-rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file par_term_emu_core_rust-0.17.0-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for par_term_emu_core_rust-0.17.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ab0a573d74f421765b3c292996661495d1da0e616213cd4bb306f034c8c10e27
MD5 267bf8311df289778a3952b45702efa2
BLAKE2b-256 8bdb08b7e02e7f652bbfa8eb49a602e6a3ef52b7d944aec11448e9fbeaab913a

See more details on using hashes here.

Provenance

The following attestation bundles were made for par_term_emu_core_rust-0.17.0-cp313-cp313-macosx_10_12_x86_64.whl:

Publisher: deployment.yml on paulrobello/par-term-emu-core-rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file par_term_emu_core_rust-0.17.0-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for par_term_emu_core_rust-0.17.0-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 4b22ba4629f59e335884e385ec34dedce6b6cdc1086c629ec8c238f9cc2684ea
MD5 34fa43046029389d538cb2594a9a298c
BLAKE2b-256 e79548c9bd6e5a5819c3d79d4f43d497c3e2378756513f52480ea270b11bbd24

See more details on using hashes here.

Provenance

The following attestation bundles were made for par_term_emu_core_rust-0.17.0-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: deployment.yml on paulrobello/par-term-emu-core-rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file par_term_emu_core_rust-0.17.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for par_term_emu_core_rust-0.17.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 fcf1cbf85dfae6c3cfd775fbde9e3de44ae2f9c4e51383d07b0b9ab793f85337
MD5 15d7a15dc879c9811d9a1a2e803ea793
BLAKE2b-256 b23bf0cee733a9039fd286a6ac08009494d04426e3dad6d83b4d802b5972b52c

See more details on using hashes here.

Provenance

The following attestation bundles were made for par_term_emu_core_rust-0.17.0-cp312-cp312-win_amd64.whl:

Publisher: deployment.yml on paulrobello/par-term-emu-core-rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file par_term_emu_core_rust-0.17.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for par_term_emu_core_rust-0.17.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 15d162bacc14f64667495b37723545b95cd6c8a260a41dffa5c263579b156a3b
MD5 0514c0f6ec2899060a320bda9e7842e9
BLAKE2b-256 62ee875288e6d067e041aa00676fd0b60f25d910d224fd179b716886b9965d72

See more details on using hashes here.

Provenance

The following attestation bundles were made for par_term_emu_core_rust-0.17.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: deployment.yml on paulrobello/par-term-emu-core-rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file par_term_emu_core_rust-0.17.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for par_term_emu_core_rust-0.17.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2d89dd7a0106187631077333b8b6c7a3316e0c36e07b9e77e101be0e86396a9f
MD5 9926826a8ffbd1096e02f3958bf88ecb
BLAKE2b-256 e78a4c48d6a23118b27e35036b3d2442fc1d8905feac48a9a6fa2a6b7878ff60

See more details on using hashes here.

Provenance

The following attestation bundles were made for par_term_emu_core_rust-0.17.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: deployment.yml on paulrobello/par-term-emu-core-rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file par_term_emu_core_rust-0.17.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for par_term_emu_core_rust-0.17.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 dc02fc1a14ef8285868f8c0d1eeedff662dc17d500d5f901b4ed11c69478b94c
MD5 5aca492dc2f92329c0d702c60eb99360
BLAKE2b-256 0912e1cb789763a925e9afbdcc32367d06c61f0ab46c1b738876969b29dff84a

See more details on using hashes here.

Provenance

The following attestation bundles were made for par_term_emu_core_rust-0.17.0-cp312-cp312-macosx_10_12_x86_64.whl:

Publisher: deployment.yml on paulrobello/par-term-emu-core-rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file par_term_emu_core_rust-0.17.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for par_term_emu_core_rust-0.17.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 1f7cf30d2b29de58d9eb6d740b2a5535008bfc832e21682689ea488e4f0fbe40
MD5 c7fa0a1677cc6ca86874cfe550933f2f
BLAKE2b-256 da8b3cd57de5017850773e7f4c9d37e6195ef918570a3e441fe424ae1ae2e475

See more details on using hashes here.

Provenance

The following attestation bundles were made for par_term_emu_core_rust-0.17.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: deployment.yml on paulrobello/par-term-emu-core-rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page