use-terminal 0.0.1

Terminal capability primitives for RustUse CLI-adjacent code
Documentation
  • Coverage
  • 100%
    31 out of 31 items documented1 out of 22 items with examples
  • Size
  • Source code size: 10.98 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 718.29 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 4s Average build duration of successful builds.
  • all releases: 4s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-cli
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-terminal

Terminal capability primitives for RustUse CLI-adjacent code.

This crate provides terminal width and height wrapper types, color support enums, interactivity enums, and dependency-free detection helpers. It does not implement terminal UI, curses, layout, or styling.

Example

use use_terminal::{ColorSupport, TerminalHeight, TerminalSize, TerminalWidth};

let size = TerminalSize::new(TerminalWidth::new(80)?, TerminalHeight::new(24)?);
let color = ColorSupport::from_env_values(None, Some("xterm-256color"), None);

assert_eq!(size.width().columns(), 80);
assert_eq!(color, ColorSupport::Ansi256);
# Ok::<(), use_terminal::TerminalDimensionError>(())

Scope

Use this crate for capability vocabulary and basic std-based detection only.