cirious_codex_term 0.2.0

Next-generation native ANSI terminal control and formatting.
docs.rs failed to build cirious_codex_term-0.2.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: cirious_codex_term-0.2.1

🖥️ Cirious Codex Term

Native ANSI Terminal Control & Formatting

CI Crates.io Docs.rs Language License


📖 Overview

Cirious Codex Term is a highly optimized, dependency-free foundational library for terminal manipulation. It provides native ANSI escape sequence generation for colors, text styling, and full cursor control.

Designed to be the ultimate bedrock for CLI tools within the Cirious ecosystem, prioritizing zero-cost abstractions and flawless terminal integration.

🚀 Quick Start

Add the following to your Cargo.toml:

[dependencies]
cirious_codex_term = "0.2"

And then in your code:

use cirious_codex_term::{Color, Cursor, Screen, Style, StyleExt};
 
fn main() {
  // Clear the screen
  Screen::clear();
   
  // Move cursor and print styled text
  Cursor::set_position(5, 5);
  print!(
    "{} {}Hello, Codex Term!{}",
    Style::Bold.to_str(),
    Color::Cyan.to_fg_str(),
    Style::Reset.to_str()
  );
   
  // Use extension traits for fluent styling
  println!("{}", "This text is red and underlined".red().underline());
   
  // Hide cursor
  Cursor::hide();
   
  // Move cursor and print again
  Cursor::set_position(10, 10);
  println!("{}", "Cursor is hidden!".green());
   
  // Show cursor
  Cursor::show();
}

🚧 Current Status & Roadmap

✅ v0.1.0 — Completed

  • Core color manipulation (16 colors, 256 colors, TrueColor RGB).
  • Text formatting traits (Bold, Italic, Blink, Dim, etc.).
  • Absolute and relative cursor positioning.
  • Screen manipulation and clearing.

✅ v0.2.0 — Completed

  • Windows ANSI: Auto-enable native ANSI support on Windows.
  • Terminal Dimensions: Methods to query terminal width and height dynamically.
  • Raw Mode Toggle: Ability to switch the terminal to raw mode for unbuffered, character-by-character input reading.
  • NO_COLOR Standard: Automatic respect for the NO_COLOR environment variable to disable styling dynamically.
  • Async Key Events: Foundational support for reading non-blocking keyboard and mouse events.

🔭 v0.3.0 — Planned

  • Mouse Tracking Support: Implement SGR-style mouse reporting (click, drag, scroll).
  • Modifier Support: Track Ctrl, Alt, and Shift for complex shortcuts.
  • Buffered Rendering: Double buffering to prevent screen flickering.
  • Event Loop Abstraction: Helper traits to manage TUI lifecycles easily.
  • Performance Optimization: Batching ANSI sequences to reduce syscalls.

📜 License

Licensed under either of the following, at your option: