blob: b12b1f18b85bbc98b5448781c10f6286e9e915bf (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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);
```
|