Skip to content

agustif/rustty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rustty - Terminal Emulator

A production-grade terminal emulator built with Rust and GPUI, featuring lock-free rendering, dedicated I/O threading, and comprehensive ANSI support.

Quick Links

Full Documentation: See docs/README.md

Project Status

Production Ready - Phase 1 complete with all critical performance optimizations implemented.

  • Core terminal emulation: ✅ Complete
  • ANSI escape sequences: ✅ Complete
  • PTY management: ✅ Complete
  • GPU-accelerated rendering: ✅ Complete
  • Performance optimizations: ✅ Complete

See Implementation Status for detailed feature list.

Features

Terminal Emulation

  • Full ANSI escape sequence support
  • 256-color and RGB color support
  • Text attributes (bold, italic, underline, strikethrough, etc.)
  • Cursor positioning and styling
  • Window title management
  • Comprehensive terminal modes

Input/Output

  • Native PTY management (Unix/Linux/macOS)
  • Dedicated I/O thread (non-blocking main thread)
  • Blocking I/O with SPSC channels
  • Signal handling
  • Dynamic window resizing

Rendering

  • GPU-accelerated with GPUI framework
  • Lock-free concurrent rendering
  • Double-buffering (flicker-free)
  • Damage tracking (optimized redraws)
  • Glyph caching (reduced CPU)
  • Text batching (reduced draw calls)

Performance

  • Input latency: <10ms
  • Frame rate: 60-120 FPS (V-sync limited)
  • CPU usage: Minimal (event-driven)
  • Memory: Configurable scrollback (typically 500KB per 10K lines)

Quick Start

Prerequisites

  • Rust 1.70+ (2021 edition)
  • Cargo
  • Platform-specific: libxcb (Linux), Xcode (macOS)

Build

git clone https://github.com/agustif/rustty.git
cd rustty
cargo build --release

Run

./target/release/rustty

For detailed setup instructions, see Quick Start Guide.

Architecture

Rustty uses a highly modular architecture with clear separation of concerns:

┌─ rustty (Main Application)
├─ rustty-ui (GPUI-based UI Layer)
├─ rustty-core (Terminal Emulation)
├─ rustty-parser (ANSI Escape Sequences)
├─ rustty-pty (PTY Management)
├─ rustty-render (GPU Rendering)
├─ rustty-config (Configuration)
├─ rustty-font (Font Management)
└─ rustty-platform (Platform Abstraction)

Key Design Decisions:

  • Lock-free reads during rendering (Arc-based)
  • Dedicated I/O thread for PTY operations
  • Event-driven notifications (no polling)
  • Double-buffering for flicker-free rendering
  • Damage tracking for optimized redraws

See Architecture Guide for complete details.

Development

Setting Up Development Environment

See Quick Start Guide for detailed setup.

Development Workflow

  • Code review via pull requests
  • Task tracking with Beads
  • Comprehensive testing (unit, integration, performance)
  • Performance profiling and benchmarking

See Development Workflow.

Building & Testing

# Build
cargo build

# Test
cargo test --release

# Format
cargo fmt

# Lint
cargo clippy

# Benchmark
cargo bench --release

Contributing

See Contributing Guide for guidelines on submitting changes.

Performance

Current Metrics

Metric Value Target Status
Input Latency (p95) <10ms <10ms ✅ Achieved
Frame Rate 60-120 FPS 60+ FPS ✅ Achieved
Render Time (p95) <80µs <100µs ✅ Achieved
CPU Usage (idle) <1% <1% ✅ Achieved

Optimization Opportunities

  • Streaming ANSI parser (reduce latency)
  • Incremental rendering (reduce CPU)
  • Advanced glyph caching (reduce memory)
  • SIMD text processing (faster text ops)

See Performance Roadmap for details.

Platform Support

  • macOS: Fully supported
  • Linux: Fully supported
  • ⚠️ Windows: Basic support (PTY implementation)

Known Limitations

  • No multiplexing (use separate terminal window)
  • No Sixel graphics protocol
  • Windows PTY support is basic
  • No session persistence

See FAQ for more information.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Contributing

We welcome contributions! See Contributing Guide.

To report bugs or suggest features, use GitHub Issues.

Acknowledgments

  • GPUI: Graphics and UI framework by Zed team
  • Rust: Systems programming language
  • Terminal Community: ANSI standards and terminal emulator design

Links


Start Here: Quick Start Guide or Architecture Overview

Last Updated: 2025-12-11

About

Rustty terminal emulator project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors