#terminal #io #current-process #writable #tty #trx

terminal-trx

Provides a handle to the terminal of the current process

8 releases

0.2.6 Dec 23, 2025
0.2.5 Oct 17, 2025
0.2.4 Jan 24, 2025
0.2.3 Aug 22, 2024
0.1.0 Jan 20, 2024

#141 in Command-line interface

Download history 30271/week @ 2025-10-13 36666/week @ 2025-10-20 31329/week @ 2025-10-27 28954/week @ 2025-11-03 32341/week @ 2025-11-10 32185/week @ 2025-11-17 30467/week @ 2025-11-24 34456/week @ 2025-12-01 33882/week @ 2025-12-08 37862/week @ 2025-12-15 20334/week @ 2025-12-22 19589/week @ 2025-12-29 29627/week @ 2026-01-05 36084/week @ 2026-01-12 38149/week @ 2026-01-19 38671/week @ 2026-01-26

144,902 downloads per month
Used in 44 crates (via terminal-colorsaurus)

MIT/Apache

43KB
923 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–3.5MB
~62K SLoC