diff options
Diffstat (limited to 'alacritty_terminal')
-rw-r--r-- | alacritty_terminal/CHANGELOG.md | 6 | ||||
-rw-r--r-- | alacritty_terminal/src/event_loop.rs | 13 | ||||
-rw-r--r-- | alacritty_terminal/src/tty/mod.rs | 4 |
3 files changed, 12 insertions, 11 deletions
diff --git a/alacritty_terminal/CHANGELOG.md b/alacritty_terminal/CHANGELOG.md index 55c21d3f..1b4824fb 100644 --- a/alacritty_terminal/CHANGELOG.md +++ b/alacritty_terminal/CHANGELOG.md @@ -8,7 +8,11 @@ sections should follow the order `Added`, `Changed`, `Deprecated`, `Fixed` and The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## 0.24.3-dev +## 0.25.0-dev + +### Changed + +- Replaced `Options::hold` with `Options::drain_on_exit` that drains, but doesn't hold, since holding can be done outside of alacritty_terminal ## 0.24.2 diff --git a/alacritty_terminal/src/event_loop.rs b/alacritty_terminal/src/event_loop.rs index 2b78f853..1bef1d4f 100644 --- a/alacritty_terminal/src/event_loop.rs +++ b/alacritty_terminal/src/event_loop.rs @@ -50,7 +50,7 @@ pub struct EventLoop<T: tty::EventedPty, U: EventListener> { tx: Sender<Msg>, terminal: Arc<FairMutex<Term<U>>>, event_proxy: U, - hold: bool, + drain_on_exit: bool, ref_test: bool, } @@ -64,7 +64,7 @@ where terminal: Arc<FairMutex<Term<U>>>, event_proxy: U, pty: T, - hold: bool, + drain_on_exit: bool, ref_test: bool, ) -> io::Result<EventLoop<T, U>> { let (tx, rx) = mpsc::channel(); @@ -76,7 +76,7 @@ where rx: PeekableReceiver::new(rx), terminal, event_proxy, - hold, + drain_on_exit, ref_test, }) } @@ -261,13 +261,10 @@ where 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. + if self.drain_on_exit { 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); break 'event_loop; } diff --git a/alacritty_terminal/src/tty/mod.rs b/alacritty_terminal/src/tty/mod.rs index eed2a76d..208547ba 100644 --- a/alacritty_terminal/src/tty/mod.rs +++ b/alacritty_terminal/src/tty/mod.rs @@ -28,8 +28,8 @@ pub struct Options { /// Shell startup directory. pub working_directory: Option<PathBuf>, - /// Remain open after child process exits. - pub hold: bool, + /// Drain the child process output before exiting the terminal. + pub drain_on_exit: bool, /// Extra environment variables. pub env: HashMap<String, String>, |