#terminal #io #writable #readable #process #write #trx

terminal-trx

Provides a handle to the terminal of the current process

2 unstable releases

0.2.0 Feb 2, 2024
0.1.0 Jan 20, 2024

#208 in Command-line interface

Download history 71/week @ 2024-01-22 40/week @ 2024-01-29 16/week @ 2024-02-05 7/week @ 2024-02-19 27/week @ 2024-02-26 10/week @ 2024-03-04 739/week @ 2024-03-11 1205/week @ 2024-03-18 625/week @ 2024-03-25 550/week @ 2024-04-01 535/week @ 2024-04-08 571/week @ 2024-04-15 528/week @ 2024-04-22 728/week @ 2024-04-29 725/week @ 2024-05-06

2,598 downloads per month
Used in 2 crates (via terminal-colorsaurus)

MIT/Apache

37KB
805 lines

terminal-trx

Docs Crate Version

Pronounced: Terminal T-Rex 🦖

Provides a handle to the terminal of the current process that is both readable and writable.

Example

use terminal_trx::terminal;
use std::io::{BufReader, BufRead as _, Write as _};

let mut terminal = terminal().unwrap();

write!(terminal, "hello world").unwrap();

let mut reader = BufReader::new(&mut terminal);
let mut line = String::new();
reader.read_line(&mut line).unwrap();

Docs

Wishlist

These are some features that I would like to include in this crate, but have not yet had the time to implement. Anyone is welcome to create a PR :)

  • Add integration tests.
  • Share the Terminal instance (like stdout, stderr, stdin in the standard library do). (Is this a good idea?)
  • Support enabling raw mode on MSYS/Cygwin.

Inspiration

This crate draws inspiration from many great resources, such as:

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions

Dependencies

~0–9.5MB
~74K SLoC