A fully async modern TUI framework for Rust (nothing blocks the main thread). Features include flexbox-like layouts, CSS-like styling, reactive state management, async readline (non-blocking alternative to POSIX readline), VT100 input/output parsers, and a double-buffered compositor optimized for SSH (paints only diffs), and much more. Works on Linux, macOS, and Windows. Add to your project with cargo add r3bl_tui.
v0.7.7 (2026-01-23)
This release introduces major architectural additions including the DirectToAnsi backend for Linux-native terminal I/O, the Resilient Reactor Thread (RRT) pattern for blocking I/O handling, comprehensive VT100 parser upgrades enabling in-memory terminal emulation, and PTY-based integration testing infrastructure. It also includes a PTY multiplexer with terminal multiplexing functionality similar to tmux.
Major Infrastructure Additions:
-
DirectToAnsi Backend (Linux-Native): A custom terminal I/O implementation bypassing Crossterm on Linux for lower latency and reduced overhead. See the DirectToAnsiInputDevice docs for architecture details.
- Direct ANSI escape sequence handling with full VT100 compliance
- Input device using
mio (epoll) for async I/O multiplexing
- Output device with
PixelCharRenderer and smart attribute diffing (~30% output reduction)
- Zero-latency ESC key detection and full keyboard modifier support
- Mouse event handling with bracketed paste support
- SIGWINCH signal integration for terminal resize
- Crossterm still used on macOS/Windows where platform APIs differ
-
Resilient Reactor Thread (RRT) Pattern: A reusable pattern for bridging blocking I/O with async Rust—spawn a dedicated thread, broadcast events to async consumers, and handle graceful shutdown automatically. The module documentation provides a comprehensive architecture overview.
ThreadSafeGlobalState<W, E> - Thread-safe singleton pattern for RRT instances
ThreadLiveness - Running state + generation tracking for safe thread reuse
SubscriberGuard<W, E> - Manages subscriber lifecycle with waker access
- Broadcasts events to async consumers via broadcast channels
- Handles graceful shutdown when all consumers disconnect
-
VT100/ANSI Output Parser & In-Memory Terminal Emulation: Complete VT100 ANSI implementation enabling snapshot testing. See the ansi module for the parser and OffscreenBuffer for the in-memory terminal.
- VTE parser integration with custom
Performer implementation
- Full support for cursor movement, erase operations, scroll regions, SGR (colors/styles)
- Enables snapshot testing: compare expected vs actual terminal state without a real terminal
-
PTY Testing Infrastructure: Real-world testing in pseudo-terminals instead of mocks. See the generate_pty_test! macro documentation for usage and the Controller/Controlled pattern.
- Controller/Controlled pattern for test isolation
generate_pty_test! macro for single-feature tests
spawn_controlled_in_pty for multi-backend comparison tests
- Backend compatibility tests verifying DirectToAnsi vs Crossterm produce identical results
- Test coverage: bracketed paste, keyboard modifiers, mouse events, SIGWINCH, UTF-8
-
Enhanced readline_async API: Expanded keyboard support makes building CLI apps easier—Tab completion, arrow key navigation, and function keys now work out of the box. See the readline_async module for the full API.
- Tab and BackTab (Shift+Tab) key support
- Navigation keys support (arrow keys, Home, End, PageUp, PageDown)
- FnKey support (F1-F12)
- Type-safe editor state methods via
ReadlineAsyncContext
- Extended
ReadlineEvent enum with new variants
-
PTY Multiplexer: Terminal multiplexing functionality similar to tmux. See the pty_mux module for the complete API.
- Enhanced support for truecolor and TUI apps that frequently re-render their UI
pty_mux_example.rs demonstrating multiplexer capabilities with multiple TUI processes
- Support for spawning and switching between multiple TUI processes using Ctrl+1 through Ctrl+9
- Live status bar showing process states (🟢 running, 🔴 stopped) and keyboard shortcuts
- OSC sequence integration for dynamic terminal title updates
- Fake resize technique for proper TUI app repainting when switching processes
- Support for configurable TUI processes: less, htop, claude, gitui
pty_simple_example.rs for basic PTY functionality demonstration
pty_rw_echo_example.rs for PTY echo testing and validation
ansi/terminal_output.rs module with high-level terminal operations
- PTY integration tests that spawn real TUI apps (eg: htop) to validate VT100 parsing
Internal Improvements:
- Changed:
- Refactored mio_poller module for improved clarity and thread reuse semantics
- Reduced DirectToAnsi input device complexity
- Thread liveness tracking integrated with mio_poller for restart capability
- Enhanced PTY read-write session with comprehensive cursor mode support
- Improved PTY input/output event handling with extensive terminal input event mapping
- Enhanced color conversion in
crossterm_color_converter.rs
- Improved styling in readline components (
apply_style_macro.rs)
- Enhanced spinner rendering with better visual feedback (
spinner_render.rs)
- Improved crossterm backend rendering operations (
render_op_impl.rs)
- Integrated with r3bl_tui's TuiColor system for consistent styling
- Cleaned up read-only session to remove read-write specific code
Development Tooling
This section documents the build infrastructure we use internally to develop r3bl_tui. While these fish scripts are specific to this repo, we're converting them into Rust binaries over time and shipping them as r3bl-build-infra—starting with cargo rustdoc-fmt, with more tools coming soon.
Rust Development Power Tools (2026-01-23)
This release focuses on developer productivity: faster builds with the nightly parallel compiler, smarter toolchain management, and a streamlined bootstrap experience. We've also removed legacy dependencies in favor of Claude Code's built-in capabilities.
Also see r3bl-build-infra—it provides cargo rustdoc-fmt for formatting rustdoc comments, which is used extensively by Claude Code skills in this repo to maintain consistent documentation style.
Changed:
- Build system migration: Migrated from nushell to fish shell for all build scripts -
run.fish replaces run.nu throughout the project for improved maintainability and readability
- Copyright headers: Shrunk copyright headers in all files for better readability
- Claude Code configuration: Updated Claude Code configuration files and VS Code settings for improved development experience
- Updated project bootstrap experience:
fzf and fish are now required for the bootstrap.sh script to work correctly, ensuring a smoother setup process
- Documentation: Updated README.md with comprehensive Claude Code integration section documenting
.claude/ directory structure, available skills, and slash commands
- Documentation: Fixed script name inconsistencies (
rust-toolchain-validate.fish not rust-toolchain-install-validate.fish)
- Documentation: Added tmux-r3bl-dev.fish development dashboard documentation
- Documentation: Clarified VSCode extensions installation workflow
Added:
-
check.fish development workflow script: Comprehensive build automation with significant performance optimizations:
- Nightly parallel frontend compiler (
-Z threads=N) for ~30-40% faster builds
- Shared tmpfs target (
$CARGO_TARGET_DIR=/tmp/roc/target/check) — all tools (Claude, VSCode, check.fish) share one RAM-based cache, so builds are always warm
- Watch modes (
--watch, --watch-doc, --watch-tests) keep the cache perpetually warm—sophisticated debounce waits for a 2-second quiet period, so rapid file changes (from typing, Claude Code, linters, etc.) don't trigger frenzied rebuilds
- Two-stage doc builds: Quick blocking (~3-5s) + full background (~90s) with staging directories that prevent the docs folder from going empty during slow rustdoc rebuilds
- ICE detection and auto-recovery for Internal Compiler Errors
- Single-instance enforcement kills orphaned watchers automatically
-
Smart rust-toolchain management (rust-toolchain-update.fish, rust-toolchain-sync-to-toml.fish): Nightly Rust is powerful but unstable—these scripts automatically find stable nightlies, validate them against your code, and remove the hassle of toolchain management entirely.
- Automated stable nightly discovery: Tests nightlies from ~1 month ago for ICE errors before committing—you get nightly features without nightly instability
- Aggressive cleanup: Removes old nightlies while preserving known-good toolchains
- Corruption recovery: Detects "Missing manifest" errors and force-removes broken toolchains
- Desktop notifications for success/failure via
notify-send
- Comprehensive logging to
~/Downloads/rust-toolchain-*.log
-
Coming soon: cargo-monitor - Rust port of check.fish as a proper cargo subcommand in r3bl-build-infra, bringing these optimizations to any Rust project
Removed:
- Legacy tools: Removed
go, mcp-language-server, serena, uv, and sccache dependencies (Claude Code now has built-in LSP; sccache proved unreliable)
Full Changelog