chore: rework unified exec events (#7775)

This commit is contained in:
jif-oai
2025-12-10 10:30:38 +00:00
committed by GitHub
parent d1c5db5796
commit 0ad54982ae
20 changed files with 876 additions and 174 deletions
+7 -3
View File
@@ -94,10 +94,8 @@ impl ExecCommandSession {
pub fn exit_code(&self) -> Option<i32> {
self.exit_code.lock().ok().and_then(|guard| *guard)
}
}
impl Drop for ExecCommandSession {
fn drop(&mut self) {
pub fn terminate(&self) {
if let Ok(mut killer_opt) = self.killer.lock() {
if let Some(mut killer) = killer_opt.take() {
let _ = killer.kill();
@@ -122,6 +120,12 @@ impl Drop for ExecCommandSession {
}
}
impl Drop for ExecCommandSession {
fn drop(&mut self) {
self.terminate();
}
}
#[derive(Debug)]
pub struct SpawnedPty {
pub session: ExecCommandSession,