terminal: Properly kill child process on terminal exit (#41562)

Release Notes:

- Fixed terminal processes occasionally leaking

Co-authored by: Jakub <jakub@zed.dev>
This commit is contained in:
Lukas Wirth authored and GitHub committed 2025-10-30 13:40:31 +00:00
1 parent 93f433e469
commit fc58d64ac6
1 file changed
+2 -1
+2 -1
View File
@@ -2241,7 +2241,8 @@ unsafe fn append_text_to_term(term: &mut Term<ZedListener>, text_lines: &[&str])
impl Drop for Terminal {
fn drop(&mut self) {
if let TerminalType::Pty { pty_tx, .. } = &self.terminal_type {
if let TerminalType::Pty { pty_tx, info } = &mut self.terminal_type {
info.kill_current_process();
pty_tx.0.send(Msg::Shutdown).ok();
}
}