mirror of
https://github.com/alacritty/alacritty.git
synced 2025-03-03 16:14:46 -05:00
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>
This commit is contained in:
parent
d28868855a
commit
18fff6a12b
2 changed files with 8 additions and 2 deletions
|
@ -12,6 +12,7 @@ Notable changes to the `alacritty_terminal` crate are documented in its
|
|||
|
||||
### Fixed
|
||||
|
||||
- Crash when trying to create a new tab without decorations enabled
|
||||
- New window being treated as focused when it's not on Wayland
|
||||
|
||||
### Changed
|
||||
|
|
|
@ -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(),
|
||||
|
|
Loading…
Add table
Reference in a new issue