diff options
author | Andrew Borg (Kashin) <1192958+aborg-dev@users.noreply.github.com> | 2025-01-16 15:04:21 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-16 15:04:21 +0000 |
commit | 5e78d20c709cb1ab8d44ca7a8702cc26d779227c (patch) | |
tree | f5174dfb36771fbfb149b338f000ab27c119baab /alacritty/src/display/window.rs | |
parent | c9c41e637ac49f3cd67cf0362c596ae9d947f896 (diff) | |
download | r-alacritty-5e78d20c709cb1ab8d44ca7a8702cc26d779227c.tar.gz r-alacritty-5e78d20c709cb1ab8d44ca7a8702cc26d779227c.tar.bz2 r-alacritty-5e78d20c709cb1ab8d44ca7a8702cc26d779227c.zip |
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`.
Diffstat (limited to 'alacritty/src/display/window.rs')
-rw-r--r-- | alacritty/src/display/window.rs | 10 |
1 files changed, 7 insertions, 3 deletions
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<X11VisualInfo>, @@ -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, |