terma

Crates.ioterma
lib.rsterma
version1.0.16
created_at2026-01-13 14:11:50.566941+00
updated_at2026-01-13 14:11:50.566941+00
descriptionA next-generation terminal compositor engine for Rust. Z-indexed layers, TrueColor, SGR mouse, Kitty keyboard, and drop-in Ratatui support.
homepage
repositoryhttps://github.com/DraconDev/terma
max_upload_size
id2040250
size2,706,586
Dracon (DraconDev)

documentation

README

⚡ Terma: The Universal TTY Engine

"We do not fight the terminal; we inhabit it."

Terma is a high-performance Application Engine built for the age of Sovereign Tools. Unlike standard TUI libraries that give you widgets, Terma gives you a Runtime.

🧠 The Core Philosophy

Most terminal libraries are just wrappers around ANSI codes. Terma treats the terminal like a Game Engine.

  1. The State is King: Instead of immediate-mode printing, Terma maintains a "Grid State" (The Truth).
  2. Layers (Z-Index): Use the Compositor to overlay modals, notifications, and floating debug panels on top of your main UI.
  3. Input Normalization: We convert raw ANSI noise into semantic Events (Keyboard Chords, Mouse Drag, Focus).

🚀 Key Features

1. The Compositor

Stop redrawing the whole screen. Use Planes.

let mut alert = Plane::new(20, 5); // 20x5 Popup
alert.set_z_index(50); // Floats above everything
alert.put_str(2, 2, "SYSTEM BREACH");
backend.compositor_mut().add_plane(alert);

2. Standardized Input

Your gaming mouse has 5 buttons. Terma supports them all.

  • Mouse: Click, Drag, Scroll, Back/Forward Buttons (SGR 1006).
  • Keyboard: Full Kitty Protocol support (Ctrl+Shift+A, Super+K).

3. Visuals (Images & Shapes)

  • Procedural Shapes: Generate rounded rectangles and gradients on the fly.
  • Images: Render high-res images via Kitty Graphics Protocol directly in the CLI.

4. Drop-in Ratatui Support

Love Ratatui widgets? Keep them. Terma includes a TermaBackend that lets you run Ratatui apps on the base layer (Z=0) while Terma manages the "God Mode" overlay layers.

📦 Installation

[dependencies]
terma = { git = "https://github.com/DraconDev/terma" }

🤝 Roadmap

  • Compositor: Layer management.
  • Input: Unified Event System.
  • State Sync: Shared memory between tiles.
  • WASM: Compilation target for web-based TTY.

Built by Dracon for the Demon Ecosystem.

Commit count: 337

cargo fmt