diff options
author | Jesse Luehrs <doy@tozt.net> | 2019-10-27 15:34:59 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2019-10-27 15:34:59 -0400 |
commit | eb310bd6f04daf97c8d2539d6f0379fb698295bc (patch) | |
tree | dd176c77c34de93abeb96f2019a7368b369fa375 /README.md | |
parent | 2f08a3340a907f2d60a500e5ed71d2ec867974be (diff) | |
download | tokio-terminal-resize-master.tar.gz tokio-terminal-resize-master.zip |
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..b12b1f1 --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# tokio-terminal-resize + +Implements a stream of terminal resize events. + +## Overview + +Whenever the user resizes their terminal, a notification is sent to the +application running in it. This crate provides those notifications in the +form of a stream. + +## Synopsis + +```rust +let stream = tokio_terminal_resize::resizes().flatten_stream(); +let prog = stream + .for_each(|(rows, cols)| { + println!("terminal is now {}x{}", cols, rows); + Ok(()) + }) + .map_err(|e| eprintln!("error: {}", e)); +tokio::run(prog); +``` |