#terminal #size #sigwinch

tokio-terminal-resize

a stream of terminal resize events

1 unstable release

0.1.0 Oct 27, 2019

#46 in #size

Download history 18/week @ 2023-08-16 12/week @ 2023-08-23 9/week @ 2023-08-30 22/week @ 2023-09-06 14/week @ 2023-09-13 11/week @ 2023-09-20 16/week @ 2023-09-27 13/week @ 2023-10-04 14/week @ 2023-10-11 20/week @ 2023-10-18 16/week @ 2023-10-25 21/week @ 2023-11-01 23/week @ 2023-11-08 17/week @ 2023-11-15 20/week @ 2023-11-22 14/week @ 2023-11-29

76 downloads per month
Used in 2 crates

MIT license

6KB
82 lines

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

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);

lib.rs:

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

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);

Dependencies

~7.5MB
~131K SLoC