Rio Terminal

website·Indexed 33 days ago

https://rioterm.com

A fast terminal emulator built in Rust. Rio features support for the Kitty graphics protocol, iTerm2 inline images, Vi mode, and RetroArch shaders. It includes a terminal engine available as a Rust crate (rio-vt) and a C ABI (librio) for integration with Swift and C. Compatible with Windows 10+, macOS, Linux, and FreeBSD.

Tokens
32.8K
Snippets
213
Records
314
Agent score
70%

What's inside Rio

  1. Overview of Rio terminal engine layers

    Rio's terminal engine is split into two embeddable layers for developers who need a terminal engine without the full application wrapper:

    • rio-vt: A safe Rust crate providing the VT state machine, ANSI/escape parser, grid with scrollback, selection, search, PTY driver, and image protocols (Sixel, Kitty, iTerm2). It contains no rendering, GPU, or font-shaping logic.
    • librio: A C ABI wrapper around the same core, allowing integration with languages like Swift, C, Go, and Python via a prebuilt static library without requiring a Rust toolchain.
  2. Overview of the Glyph Protocol

    The Glyph Protocol allows terminal applications to ship custom vector glyphs to the terminal at runtime. Instead of requiring users to install patched fonts (like Nerd Fonts), the application registers a vector outline for a Private Use Area (PUA) codepoint. The terminal then rasterizes this outline at render time. Registrations are session-based and expire when the application exits.
  3. Overview of Rio's hints system

    Rio's hints system allows users to interact with text patterns in the terminal by displaying keyboard shortcuts over matching content. When hint mode is activated, Rio scans the visible terminal for configured patterns (e.g., URLs, file paths) and overlays labels. Pressing the corresponding keys executes a configured action (copy, open, etc.).
  4. Canario macOS frontend features

    Canario is an experimental macOS frontend built on librio (distributed as Canario.dmg). It implements a browser-like workflow with the following features:

    • Navigation: Use ⌘1 through ⌘9 to jump between colored spaces.
    • Command Bar: ⌘K opens a bar to find terminals/panes by title or run app actions.
    • Quick Terminal: ⌥⌘T summons a floating quick terminal over the frontmost application.
    • Routing: New shells can be routed into spaces based on their working directory.
    • Session Restore: Full restoration of the sidebar tree, splits, scrollback, and each pane's working directory.
    • Previews: Hovering a tab or pane in the sidebar shows a live preview.
  5. Embed the Rio terminal engine using rio-vt or librio

    Rio's terminal core is available as an embeddable library. Developers can use rio-vt, a standalone Rust crate providing the VT state machine, ANSI/escape parser, grid with scrollback, selection, search, PTY driver, and image protocols (Sixel, Kitty, iTerm2). For non-Rust languages (Swift, C, etc.), librio provides a C ABI via RioKit.xcframework or librio.a and librio.h.
  6. Super Rio Native macOS Application

    Super Rio is a native macOS application built in Swift that uses librio as its underlying terminal engine. It serves as a showcase for librio and is the primary platform for exploring AI-driven terminal features, such as inline suggestions, natural language commands, and intelligent context awareness.
  7. Render Nerd Font icons in Canario

    Canario supports Nerd Font icons out of the box without requiring a patched font to be installed on the host machine. This is achieved by:

    1. Embedded Symbols: A symbols-only Nerd Font is embedded in librio, which Canario uses as a fallback when the primary terminal font lacks a glyph.
    2. Glyph Scaling: Canario uses a port of the Nerd Fonts patcher's scaling table (via ghostty) to correctly size and position icons. This ensures Powerline triangles stretch to fill cells and icons are centered according to the patcher's height rules.
  8. Understand Rio's GPU image rendering architecture

    Rio renders each Kitty image using its own dedicated GPU texture and a separate rendering pipeline from text. This architecture prevents GPU memory leaks and ensures that textures are efficiently cleaned up once the image is no longer displayed.
  9. Handle terminal images in rio-vt

    The core engine decodes Sixel, Kitty, and iTerm2 image transmissions and surfaces them via events. This allows the frontend to record image data without needing its own image-format handling logic.
  10. New Rio Terminal UI Features

    Rio has introduced several new user interface features to improve discoverability and navigation:

    • Command Palette: A built-in palette for keyboard-driven interface access.
    • Island-style Tab Bar: A completely redesigned tab navigation system.
    • Title Bar Progress Bar: Visual progress indicators for long-running operations appear in the title bar.
    • Tab Customization: Users can now rename tabs and change their colors directly through the UI.
    • Welcome Screen: A refreshed first-launch experience.