From bb4fddd59365ec9bbff43b48da5fca23e9c55a99 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Thu, 17 Dec 2020 00:39:15 +0000 Subject: Fix draining of PTY when holding on exit Fixes #4189. --- alacritty_terminal/src/event_loop.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'alacritty_terminal/src') diff --git a/alacritty_terminal/src/event_loop.rs b/alacritty_terminal/src/event_loop.rs index 035c1e73..f3d4d353 100644 --- a/alacritty_terminal/src/event_loop.rs +++ b/alacritty_terminal/src/event_loop.rs @@ -342,9 +342,14 @@ where token if token == self.pty.child_event_token() => { if let Some(tty::ChildEvent::Exited) = self.pty.next_child_event() { - if !self.hold { + if self.hold { + // With hold enabled, make sure the PTY is drained. + let _ = self.pty_read(&mut state, &mut buf, pipe.as_mut()); + } else { + // Without hold, shutdown the terminal. self.terminal.lock().exit(); } + self.event_proxy.send_event(Event::Wakeup); break 'event_loop; } -- cgit