mirror of
https://github.com/openai/codex.git
synced 2026-11-28 23:34:06 +00:00
chore: rework unified exec events (#7775)
This commit is contained in:
1 parent
d1c5db5796
commit
0ad54982ae
20 files changed
+876
-174
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user