use std::sync::Arc;
use super::{PtyTap, ScriptedRunner};
impl ScriptedRunner {
#[track_caller]
fn pty_tap(&self, spawn_index: usize) -> Arc<PtyTap> {
self.spawned.lock().unwrap()[spawn_index]
.pty
.clone()
.expect("that spawn asked for no terminal")
}
#[must_use]
#[track_caller]
pub fn pty_input(&self, spawn_index: usize) -> Vec<u8> {
self.pty_tap(spawn_index).input()
}
#[must_use]
#[track_caller]
pub fn pty_sizes(&self, spawn_index: usize) -> Vec<(u16, u16)> {
self.pty_tap(spawn_index).sizes()
}
#[track_caller]
pub fn pty_emit(&self, spawn_index: usize, bytes: &[u8]) {
self.pty_tap(spawn_index).emit(bytes);
}
#[track_caller]
pub fn pty_end(&self, spawn_index: usize) {
self.pty_tap(spawn_index).end();
}
#[must_use]
#[track_caller]
pub fn pty_subscribers(&self, spawn_index: usize) -> usize {
self.pty_tap(spawn_index).subscribers()
}
}