diff options
author | William Viktorsson <williamviktorsson@gmail.com> | 2024-04-21 01:11:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-20 23:11:46 +0000 |
commit | 18fff6a12b2d20ae76fc3152db01daaa71a96aba (patch) | |
tree | 4135cc6a0e523a91a8732d2cc6af9448fec451fb /alacritty | |
parent | d28868855afd769209a7ac81692cdbaa67be2905 (diff) | |
download | r-alacritty-18fff6a12b2d20ae76fc3152db01daaa71a96aba.tar.gz r-alacritty-18fff6a12b2d20ae76fc3152db01daaa71a96aba.tar.bz2 r-alacritty-18fff6a12b2d20ae76fc3152db01daaa71a96aba.zip |
Fix crash when trying to open a new tab on macOS
This fixes an issue where Alacritty would crash when trying to open a
new tab on macOS while having decorations disabled.
Co-authored-by: Christian Duerr <contact@christianduerr.com>
Diffstat (limited to 'alacritty')
-rw-r--r-- | alacritty/src/input/mod.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/alacritty/src/input/mod.rs b/alacritty/src/input/mod.rs index 9a96b45b..365717c3 100644 --- a/alacritty/src/input/mod.rs +++ b/alacritty/src/input/mod.rs @@ -36,6 +36,8 @@ use alacritty_terminal::vi_mode::ViMotion; use alacritty_terminal::vte::ansi::{ClearMode, Handler}; use crate::clipboard::Clipboard; +#[cfg(target_os = "macos")] +use crate::config::window::Decorations; use crate::config::{Action, BindingMode, MouseAction, SearchAction, UiConfig, ViAction}; use crate::display::hint::HintMatch; use crate::display::window::Window; @@ -385,8 +387,11 @@ impl<T: EventListener> Execute<T> for Action { Action::CreateNewWindow => ctx.create_new_window(None), #[cfg(target_os = "macos")] Action::CreateNewTab => { - let tabbing_id = Some(ctx.window().tabbing_id()); - ctx.create_new_window(tabbing_id); + // Tabs on macOS are not possible without decorations. + if ctx.config().window.decorations != Decorations::None { + let tabbing_id = Some(ctx.window().tabbing_id()); + ctx.create_new_window(tabbing_id); + } }, #[cfg(target_os = "macos")] Action::SelectNextTab => ctx.window().select_next_tab(), |