From 5e78d20c709cb1ab8d44ca7a8702cc26d779227c Mon Sep 17 00:00:00 2001 From: "Andrew Borg (Kashin)" <1192958+aborg-dev@users.noreply.github.com> Date: Thu, 16 Jan 2025 15:04:21 +0000 Subject: Add option to drain PTY on shutdown This patch removes the `hold` option on `alacritty_terminal` in favor of a `drain_on_exit` option, which will drain the PTY before shutdown. The hold logic is instead handled in `alacritty`. --- alacritty/src/display/window.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'alacritty/src/display/window.rs') diff --git a/alacritty/src/display/window.rs b/alacritty/src/display/window.rs index fe40fab5..f9fb9272 100644 --- a/alacritty/src/display/window.rs +++ b/alacritty/src/display/window.rs @@ -109,6 +109,9 @@ pub struct Window { /// Flag indicating whether redraw was requested. pub requested_redraw: bool, + /// Hold the window when terminal exits. + pub hold: bool, + window: WinitWindow, /// Current window title. @@ -127,7 +130,7 @@ impl Window { event_loop: &ActiveEventLoop, config: &UiConfig, identity: &Identity, - _options: &mut WindowOptions, + options: &mut WindowOptions, #[rustfmt::skip] #[cfg(all(feature = "x11", not(any(target_os = "macos", windows))))] x11_visual: Option, @@ -139,7 +142,7 @@ impl Window { #[cfg(all(feature = "x11", not(any(target_os = "macos", windows))))] x11_visual, #[cfg(target_os = "macos")] - &_options.window_tabbing_id.take(), + &options.window_tabbing_id.take(), ); if let Some(position) = config.window.position { @@ -148,7 +151,7 @@ impl Window { } #[cfg(not(any(target_os = "macos", windows)))] - if let Some(token) = _options + if let Some(token) = options .activation_token .take() .map(ActivationToken::from_raw) @@ -199,6 +202,7 @@ impl Window { let is_x11 = matches!(window.window_handle().unwrap().as_raw(), RawWindowHandle::Xlib(_)); Ok(Self { + hold: options.terminal_options.hold, requested_redraw: false, title: identity.title, current_mouse_cursor, -- cgit