1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-11 13:51:01 -05:00

Fix draining of PTY when holding on exit

Fixes #4189.
This commit is contained in:
Christian Duerr 2020-12-17 00:39:15 +00:00 committed by GitHub
parent b4dccbe526
commit bb4fddd593
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -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 - 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 - 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 - No live config update when starting Alacritty with a broken configuration file
- PTY not drained to the end with the `--hold` flag enabled
### Removed ### Removed

View file

@ -342,9 +342,14 @@ where
token if token == self.pty.child_event_token() => { token if token == self.pty.child_event_token() => {
if let Some(tty::ChildEvent::Exited) = self.pty.next_child_event() { 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.terminal.lock().exit();
} }
self.event_proxy.send_event(Event::Wakeup); self.event_proxy.send_event(Event::Wakeup);
break 'event_loop; break 'event_loop;
} }