Skip to content

Repository files navigation

term-string Travis Build StatusAppVeyor Build Status

Documentation

Provide a string and a style type for terminal formatted output.

Why?

I noticed that crates tend to either depend on ansi_term directly, and thus lack Windows console support (prior to Windows 10), or include their own wrapping code around term.

This crate is an attempt to create a nice usable wrap around term everyone can use. It should just work with terminfo terminals, Windows 10 virtual terminal support*, and the Windows console.

* Requires a personal term branch, for now.

Examples

First, add the dependency to Cargo.toml:

[dependencies]
term-string = { git = "https://github.com/rust-alt/term-string.git" }
// color is a re-exported module from termuse term_string::color::{GREEN,RED};use term_string::{TermString,TermStyle};// Create term styleslet style1 = TermStyle::bold() + TermStyle::fg(GREEN) + TermStyle::bg(RED);let style2 = TermStyle::underline(true);// Create term string from a style and a string valueletmut ts = TermString::new(style1,"style");// "1" inherits style1
ts+= "1";// " : " is un-styled
ts += TermString::from(" : ");
ts += TermString::new(style2,"This is text with style 2");
ts.println();

Detailed Build Status

Travis

LinuxOSX
linux-stableosx-stable
linux-betaosx-beta
linux-nightlyosx-nightly

AppVeyor

Windowsx86_64i686
stablesatble x86_64stable i686
betabeta x86_64beta i686
nightlynightly x86_64nightly i686

About

Provide a string and a style type for terminal formatted output.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages