diff options
author | Kirill Bulatov <mail4score@gmail.com> | 2024-03-09 13:32:32 +0200 |
---|---|---|
committer | Christian Duerr <contact@christianduerr.com> | 2024-03-19 02:20:53 +0100 |
commit | 0a859ae3732d0f378474f80107186e46b61148fc (patch) | |
tree | 9cd482ea1aafc053bc4bfe656462a5303d3e4f93 /alacritty_terminal/src/event_loop.rs | |
parent | 99e52bab77c2ff1412088a15b9aa2111a193d244 (diff) | |
download | alacritty-0a859ae3732d0f378474f80107186e46b61148fc.tar.gz alacritty-0a859ae3732d0f378474f80107186e46b61148fc.zip |
Send exit code events on child process exit
Fixes #7753.
Diffstat (limited to 'alacritty_terminal/src/event_loop.rs')
-rw-r--r-- | alacritty_terminal/src/event_loop.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/alacritty_terminal/src/event_loop.rs b/alacritty_terminal/src/event_loop.rs index 42025b00..929c642d 100644 --- a/alacritty_terminal/src/event_loop.rs +++ b/alacritty_terminal/src/event_loop.rs @@ -259,7 +259,11 @@ where for event in events.iter() { match event.key { tty::PTY_CHILD_EVENT_TOKEN => { - if let Some(tty::ChildEvent::Exited) = self.pty.next_child_event() { + if let Some(tty::ChildEvent::Exited(code)) = self.pty.next_child_event() + { + if let Some(code) = code { + self.event_proxy.send_event(Event::ChildExit(code)); + } if self.hold { // With hold enabled, make sure the PTY is drained. let _ = self.pty_read(&mut state, &mut buf, pipe.as_mut()); @@ -267,7 +271,6 @@ where // Without hold, shutdown the terminal. self.terminal.lock().exit(); } - self.event_proxy.send_event(Event::Wakeup); break 'event_loop; } |