tastty-core 0.1.0

Sans-IO core of the tastty terminal session library: VT parser, screen buffer, and byte encoders.
1
2
3
4
5
6
7
8
9
10
11
12
13
use super::super::{Screen, ScreenEvent};

pub(in crate::screen) fn handle_set_shape(screen: &mut Screen, params: &[&[u8]]) {
    // An empty name is the protocol's "restore default pointer" signal;
    // the embedder is expected to interpret it as "idle pointer".
    let name = params
        .get(1)
        .map(|raw| String::from_utf8_lossy(raw).into_owned())
        .unwrap_or_default();
    screen
        .pending_events
        .push(ScreenEvent::MousePointerShape { name });
}