Crate statusline

source ·
Expand description

Status line for shells with ANSI escape sequences support

This is a documentation for statusline API, use README.md for executable documentation

§Example

Default statusline as a readline prompt generator:

use statusline::{default, Environment, IconMode, Style};

let mode = IconMode::build();
let args = Environment::from_env::<&str>(&[]);
let top = default::extend(default::top(&args));
let bottom = default::bottom(&args);

// Top line is not intended to use in readline-like environments
eprintln!("{}", default::pretty(&top, &mode));

// But bottom line is --- because it has "invisibility"
print!(
    "{}{}",
    default::title(&args).invisible(),
    default::pretty(&bottom, &mode)
);

Modules§

Structs§

  • Environment variables available to statusline
  • Styled “string”-like object

Enums§

Traits§

  • Associated icon getter, which respects icon mode
  • Pretty formatter with respect to selected icon mode
  • Simple block which can be extended (only once) and pretty-printed
  • Styling functions for function chaining