aboutsummaryrefslogtreecommitdiff
path: root/alacritty_terminal/src
diff options
context:
space:
mode:
Diffstat (limited to 'alacritty_terminal/src')
-rw-r--r--alacritty_terminal/src/event_loop.rs13
-rw-r--r--alacritty_terminal/src/tty/mod.rs4
2 files changed, 7 insertions, 10 deletions
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>,