alacritty / alacritty

A cross-platform, OpenGL terminal emulator.
https://alacritty.org
Apache License 2.0
55.54k stars 2.99k forks source link

macOS: Creating a new tab when terminal is in SimpleFullScreen mode opens tab in a new window #7626

Open sl4m opened 8 months ago

sl4m commented 8 months ago

I haven't seen anyone else report this. When alacritty is not in SimpleFullScreen mode, new tab creation works as expected. Is this a known issue?

System

OS: macOS Sonoma latest Version: alacritty 0.13.1 (fe2a3c5)

Logs

Crashes: N/A Font/Terminal size:

[0.000003500s] [INFO ] [alacritty] Welcome to Alacritty
[0.000789041s] [INFO ] [alacritty] Version 0.13.1 (fe2a3c5)
[0.001582041s] [INFO ] [alacritty] Configuration files loaded from:
                                     "/Users/skim/.alacritty.toml"
                                     "/Users/skim/.config/colours/tomorrow-night-256.toml"
[0.002712458s] [DEBUG] [alacritty] Using environment locale: en_US.UTF-8
[0.028418541s] [INFO ] [alacritty] Using Apple CGL
[0.043234666s] [DEBUG] [alacritty] Picked GL Config:
                                     buffer_type: Some(Rgb { r_size: 8, g_size: 8, b_size: 8 })
                                     alpha_size: 8
                                     num_samples: 0
                                     hardware_accelerated: true
                                     supports_transparency: Some(true)
                                     config_api: Api(OPENGL)
                                     srgb_capable: true
[0.063517291s] [INFO ] [alacritty] Window scale factor: 2
[0.064318666s] [DEBUG] [alacritty] Loading "Mensch" font
[0.083453875s] [INFO ] [alacritty] Running on Apple M2 Ultra
[0.083484625s] [INFO ] [alacritty] OpenGL version 4.1 Metal - 88, shader_version 4.10
[0.083495333s] [INFO ] [alacritty] Using OpenGL 3.3 renderer
[0.087088625s] [DEBUG] [alacritty] Filling glyph cache with common glyphs
[0.088921458s] [INFO ] [alacritty] Cell size: 18 x 36
[0.088941375s] [INFO ] [alacritty] Padding: 2 x 2
[0.088950250s] [INFO ] [alacritty] Width: 1600, Height: 1200
[0.175626250s] [INFO ] [alacritty] PTY dimensions: 33 x 88
[0.178481875s] [INFO ] [alacritty] Initialisation complete
[0.209736083s] [DEBUG] [alacritty_terminal] New num_cols is 284 and num_lines is 79
[0.210939125s] [INFO ] [alacritty] Padding: 2 x 2
[0.210965250s] [INFO ] [alacritty] Width: 5120, Height: 2880
kchibisov commented 8 months ago

How do you open a tab? With the default CreateNewTab(Cmd+T) binding or with the CreateNewWindow(Cmd+N and changing settings in macOS)? The Tab one should work in general and actually try to create tabs unlike the latter one.

sl4m commented 8 months ago

@kchibisov It was with CreateNewTab. It creates a new window instead of a new tab within the existing window. This new window is not in SimpleFullScreen mode which allows me to create new tabs within the new window.

Interestingly, if I have a window with multiple tabs and go into SimpleFullScreen mode, the current tab breaks off of the existing window and becomes its own window/tab in fullscreen. The other tabs remain intact in the existing window.

As a workaround, I am setting alacritty to Maximized mode which allows me to have multiple tab support and near fullscreen mode.

chrisduerr commented 8 months ago

@sl4m How do other macOS apps behave with regards to this? Maybe that's just how Apple envisions multi-tab "simple fullscreen" to work.

sl4m commented 8 months ago

@chrisduerr I can only speak of one other terminal: iTerm 2. It allows the user to create multiple tabs whilst being in SimpleFullScreen mode. I can't say for certain if that follows Apple's guidelines though.

chrisduerr commented 8 months ago

@sl4m macOS should allow any application to have tabs with the "new window as tabs" option. That's the only thing I'm curious about, I don't know if iTerm has its own tabs or not.

labrnth commented 8 months ago

I'm also noticing this. I much prefer the SimpleFullscreen over the native Fullscreen as it's so much faster because it's not consuming a completely separate space. As the OP mentioned, it works with iTerm2 but they may be doing something non-standard to make this work.

If using the "Zoom" feature by holding the Option + mouse over the green window button and clicking Zoom, it only partially does the job. The menu bar is still present when using Zoom. The preference would be to have the menubar hidden and just the tabs in a Fullscreen.

There is some good information on this website about how to get this working.

https://notes.alinpanaitiu.com/Fullscreen-apps-above-the-MacBook-notch

Mo0rBy commented 7 months ago

I'm not sure if this is the same issue as you are describing or not as I don't know what the difference is between SimpleFullScreen and regular Fullscreen and my issue is to do with a new Window, not a new a new tab, but I just found that when Alacritty is fully maximised (by clicking the green fullscreen button in the title bar), using Cmd + n to create a new window does not work, but when alacritty is a floating window on the desktop, this shortcut works just fine.

If this is not the same issue, I can create a new issue and add some video evidence to it to help show the behaviour.

dgordon9221 commented 7 months ago

Not sure if this is at all related to your issue, but I find the same exact behaviour in the following circumstances.

  1. Decorations: None - Cmd+T opens a new window no matter which window mode I am in.
  2. Decorations: Default - Cmd+T opens a new tab as expected successfully on Maximized or regular Windowed mode, but opens a new window on SimpleFullscreen. Every other mode (even Fullscreen) opens a new tab in this case, but if you hold the mouse at the top of the screen you can see that on Fullscreen there is a "hidden" bar, and you can switch between the tabs in there. For SimpleFullscreen there is no "hidden" bar at all. Seems to me that it could be because there is no bar.

I also noticed a really annoying thing in SimpleFullscreen where the top line is going underneath the notch so I can't read what is going on. Not sure if that's exactly related, just something I noticed while testing this.

Konnko commented 6 months ago

For me it is startup_mode = "Fullscreen" that causes this bug. Both Cmd+T and Cmd+N start opening tabs in a new window with this line in config.

Sonoma 14.4, Alacritty 0.13.1

https://github.com/alacritty/alacritty/assets/87249792/0aa38ebe-486e-4dc7-8ccf-38e28d396307

RangerRick commented 3 months ago

I am in default "Windowed" mode and I also see this behavior on Sonoma 14.4.1.

When I hit Command+Shift+N I get a new tab, rather than a new window.

(edit) For what it's worth, I just updated to Sonoma 14.5 and it also does this.

a-ml commented 3 months ago

Hello,

I've the following keyboard binding and Cmd+T or Cmd+Shift+N opens always a new window in normal or fullscreen.

Here the binding configured.

[window]
padding.x = 10
padding.y = 10

decorations = "Buttonless"

[keyboard]
bindings = [
{ key = "N", mods = "Command|Shift", action = "CreateNewTab" },
{ key = "X", mods = "Command|Shift", action = "ToggleFullscreen" },
{ key = "H", mods = "Command|Shift", action = "HideOtherApplications" },
]
RangerRick commented 3 months ago

Aha!

So this is my config:

live_config_reload = true

[font]
size = 14

[font.normal]
family = "MesloLGS NF"

[keyboard]
bindings = [
  { key = "N", mods = "Command|Shift", action = "CreateNewWindow" },
  { key = "ArrowLeft", mods = "Command", action = "SelectPreviousTab" },
  { key = "ArrowRight", mods = "Command", action = "SelectNextTab" },
]

If I add this one change, it works:

[window]
decorations = "Buttonless"

...until I relaunch Alacritty, at which point I have no buttons and no tabs. 😅

I played with it a bit, and my bug appears to actually be that when the decorations is"Full", CreateNewWindow actually creates a new tab, but when it's set to anything else, it creates a new window.

Which I think is maybe a different issue than the one opened here? Not sure.

ajmichels commented 3 months ago

@RangerRick noticed the same thing.

And when the app is in fullscreen the new windows show up on top of the existing fullscreen app, which is an abnormal state in macOS.

I also noticed that you cannot create a new Alacritty window from a desktop that does not already have an Alacritty window on it, even when Alacritty is still the active app. This would be less of an issue if it were possible to create new windows for Alacritty from either the app menu dropdown or from right clicking on the dock icon.

Related to this I came across issue #4266 which I think should still be open. The typical behavior for applications on macOS is for the app to remain active unless it is explicitly quit. So even if there are no active windows the app would still be open and it would be possible to create a new window with either the app menu, dock, or keyboard shortcuts. Usually the atypical behavior of closing the app when the last window is closed is configurable on a per application bases.

sfsam commented 2 months ago

In addition, if you have a window with multiple tabs and then go into SimpleFullScreen, only the currently active tab will go into SimpleFullScreen mode. If you try to toggle it out of SimpleFullScreen, your next tab will go into SimpleFullScreen. This will keep happening until you've put all your tabs into SimpleFullScreen. Then, you can toggle each one out. Now you will have multiple separate windows, one for each tab. Essentially, Alacritty's SimpleFullScreen disaggregates your tabs.

Instead, it should work like regular FullScreen: The whole window with all tabs goes full screen at once and toggling brings the window out of full screen with all tabs intact.