Pronounced: Terminal T-Rex 🦖
Provides a handle to the terminal of the current process that is both readable and writable.
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();
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 (likestdout
,stderr
,stdin
in the standard library do). (Is this a good idea?) - Support enabling raw mode on MSYS/Cygwin.
This crate draws inspiration from many great resources, such as:
- This Gist by Tavian Barnes
- nix-ptsname_r-shim
Licensed under either of
- Apache License, Version 2.0 (license-apache.txt or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (license-mit.txt or http://opensource.org/licenses/MIT)
at your option.
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