How orhun/ratty works
Ratty is a GPU-rendered terminal emulator that runs terminal applications while adding 2D/3D presentation, a custom cursor, inline 3D objects, and Kitty image support. The principal workflow is terminal input and PTY output feeding a terminal screen, which is rendered and presented through GPU-backed terminal surfaces; camera and input controls change the view. Ratty also exposes a local control bridge and an RGP widget for client applications. Some links reflect README capabilities because unsampled implementation details are not available here.
Main entry points: runtime.rs PTY runtime · inline.rs Inline object state · control.rs Control bridge · keyboard.rs Keyboard handling
Components 19
Terminal Runtime
- PTY runtime
src/runtime.rs - Terminal screen state
src/screen.rs - Terminal surface
src/terminal.rs - GPU text renderer
src/rendering.rs - Configuration
src/config.rs
Input and Control
- Keyboard handling
src/keyboard.rs - Mouse and selection
src/mouse.rs - Control bridge
src/control.rs - MCP server
src/bin/ratty-mcp.rs
Graphics and Objects
- Camera modes
src/camera.rs - Scene presentation
src/scene/mod.rs - Runtime systems
src/systems.rs - 3D model loading
src/model.rs - Inline object state
src/inline.rs - Kitty graphics
src/kitty.rs
Protocol Clients
- RGP protocol
src/rgp.rs - Ratatui RGP widget
widget/src/lib.rs
Other components
- Terminal user
- Terminal application
Connections 21
- Terminal user → Keyboard handling: types input
README.md - Terminal user → Mouse and selection: uses controls
README.md - Keyboard handling → PTY runtime: writes input
src/keyboard.rs - Mouse and selection → PTY runtime: writes input
src/mouse.rs - Terminal application → PTY runtime: exchanges terminal data
README.md - PTY runtime → Terminal screen state: updates screen
src/runtime.rs - Terminal screen state → Terminal surface: supplies terminal state
src/terminal.rs - Terminal surface → GPU text renderer: renders text
README.md - Configuration → Keyboard handling: configures bindings
src/keyboard.rs - Terminal user → Camera modes: changes view
README.md - Camera modes → Scene presentation: selects presentation
src/camera.rs - Scene presentation → GPU text renderer: presents graphics
README.md - Inline object state → 3D model loading: loads objects
src/inline.rs - Inline object state → RGP protocol: consumes protocol
src/inline.rs - Inline object state → Kitty graphics: handles graphics
src/inline.rs - Runtime systems → Inline object state: synchronizes objects
src/systems.rs - Runtime systems → Scene presentation: updates presentation
src/systems.rs - MCP server → Control bridge: uses bridge
src/control.rs - Control bridge → PTY runtime: writes agent input
src/control.rs - Control bridge → Camera modes: updates camera
src/control.rs - Ratatui RGP widget → RGP protocol: emits protocol
README.md