diff options
author | Christian Duerr <contact@christianduerr.com> | 2020-12-17 00:39:15 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-17 00:39:15 +0000 |
commit | bb4fddd59365ec9bbff43b48da5fca23e9c55a99 (patch) | |
tree | 9a99d6fa07db2a1ec9a886faa650f046c2dff636 | |
parent | b4dccbe5261a11a7e9587521a96a4098a8754006 (diff) | |
download | alacritty-bb4fddd59365ec9bbff43b48da5fca23e9c55a99.tar.gz alacritty-bb4fddd59365ec9bbff43b48da5fca23e9c55a99.zip |
Fix draining of PTY when holding on exit
Fixes #4189.
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | alacritty_terminal/src/event_loop.rs | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index b042f01c..55e16249 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Window being always on top during alt-tab on Windows - Cursor position not reported to apps when mouse is moved with button held outside of window - No live config update when starting Alacritty with a broken configuration file +- PTY not drained to the end with the `--hold` flag enabled ### Removed 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; } |