neimar 0.1.0

TUI app for managing multiple AI bot sessions in a terminal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::app::App;
use crate::types::AppEvent;

pub(crate) fn apply_event(app: &mut App, event: AppEvent) {
    match event {
        AppEvent::PtyOutput(id, bytes) => {
            if let Some(session) = app.session_by_id_mut(id) {
                session.process_pty_output(&bytes);
            }
        }
        AppEvent::PtyExited(id) => {
            if let Some(session) = app.session_by_id_mut(id) {
                session.mark_exited();
            }
        }
    }
}