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
14
use super::super::{Screen, ScreenEvent};

pub(in crate::screen) fn handle_set(screen: &mut Screen, params: &[&[u8]]) {
    if let Some(text) = params.get(1) {
        screen.cwd = if text.is_empty() {
            None
        } else {
            Some(String::from_utf8_lossy(text).into_owned())
        };
        screen
            .pending_events
            .push(ScreenEvent::WorkingDirectoryChanged);
    }
}