Add fresh default sessions and terminal status handling
ci / test (push) Has been cancelled
ci / remote-bench (push) Has been cancelled

This commit is contained in:
Codex
2026-06-11 09:41:46 -04:00
parent 92f43df046
commit 0eca4f1cf4
10 changed files with 236 additions and 19 deletions
+18 -2
View File
@@ -34,6 +34,7 @@ impl PtyHandle {
pub struct PtyOutput {
pub session: String,
pub bytes: Vec<u8>,
pub exited: bool,
}
pub fn spawn_pty_session(
@@ -75,14 +76,29 @@ pub fn spawn_pty_session(
let mut buf = [0u8; 8192];
loop {
match reader.read(&mut buf) {
Ok(0) => break,
Ok(0) => {
let _ = tx.send(PtyOutput {
session: reader_session.clone(),
bytes: Vec::new(),
exited: true,
});
break;
}
Ok(n) => {
let _ = tx.send(PtyOutput {
session: reader_session.clone(),
bytes: buf[..n].to_vec(),
exited: false,
});
}
Err(_) => break,
Err(_) => {
let _ = tx.send(PtyOutput {
session: reader_session.clone(),
bytes: Vec::new(),
exited: true,
});
break;
}
}
}
})