rmux-server 0.9.0

Tokio daemon and request dispatcher for the RMUX terminal multiplexer.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
pub(crate) fn status_line_count(status: Option<&str>, rows: u16) -> u16 {
    if rows == 0 || matches!(status, Some("off")) {
        return 0;
    }
    let requested = match status {
        Some("on") | None => 1,
        Some(value) => value.parse::<u16>().unwrap_or(1),
    };
    requested.clamp(1, rows)
}

pub(crate) fn content_rows_for_status(status: Option<&str>, rows: u16) -> u16 {
    rows.saturating_sub(status_line_count(status, rows))
}