17 Commits

Author SHA1 Message Date
Mitchell Hashimoto
59f54a1d88 macos: initial window save/restore is working for frames only 2023-12-22 21:24:27 -08:00
Mitchell Hashimoto
97433d3aa1 macos: close all windows
Fixes #1052

This implements a `close_all_windows` binding in the core and implements
it for macOS specifically. This will ask for close confirmation if any
surface in any of the windows requires confirmation.

This is bound by default to option+shift+command+w to match Safari. The
binding is generall option+command+w but users may expect this to also
mean "Close All Other Tabs" which is the changed behavior if any tabs
are present in a standard macOS application. So I chose to follow Safari
instead.

This doesn't implement this feature for GTK, that's left as an exercise
for a contributor.
2023-12-17 20:54:57 -08:00
Mitchell Hashimoto
ec989d6b46 macos: newTab needs to call Controller.showWindow 2023-12-08 08:46:05 -08:00
Mitchell Hashimoto
4b25356625 macos: manually show window to handle mission control behavior
Fixes #1018
Fixes #1020

This disables the "visibleAtLaunch" configuration in the xib and
manually shows the window when it loads. This lets us carefully control
what happens particularly when a window is full screen (native) and part
of Mission Control.

Previously, the behavior depended on the Settings.app "Prefer tabs
when opening documents" setting, but we didn't handle every behavior
correctly (see #1018 and #1020). I couldn't find a way to robustly
handle all cases because there are no published macOS APIs for
interacting with Mission Control...

Plus, terminals aren't really "documents" so it did confuse at least one
user that Ghostty would follow this configuration. We just incidently
did because we use native tabbing.

This PR takes full control into our own hands. Our behavior is now:

  - If a new window is created from a native fullscreen window, the
    new window is created into native fullscreen.

  - If a new tab is created from a native fullscreen window, the
    tab is added to the existing window and does not create a new space.

  - If a window or tab is created from a non-fullscreen window, the
    existing behaviors remain.
2023-12-07 22:44:47 -08:00
Mitchell Hashimoto
3f76094d84 macos: handle the "+" button automatically adding the window to the tabs
Fixes #1010
2023-12-07 14:39:54 -08:00
Mitchell Hashimoto
6fed7cde19 macos: do not open an initial window if opening from URL 2023-12-01 19:28:06 -08:00
Mitchell Hashimoto
efe9721c98 macos: honor fullscreen setting 2023-11-06 08:52:36 -08:00
Mitchell Hashimoto
3bef50f0cf macos: deminiaturize on new tab 2023-11-03 09:35:14 -07:00
Mitchell Hashimoto
cad461fff7 macos: modify tabbing mode when entering/exiting fullscreen
Related to #799

With tabbing mode disabled, fullscreen (native) windows when creating a
new tab creates a window in the tab bar, but ALSO puts the window into a
new "screen" on macOS. When you click the tab bar, macOS animates
between screens. Its jarring!

This commit makes it so that in fullscreen we go back to automatic
tabbing even for new windows, which produces new windows within a tab.
This is normal default behavior for macOS tabbed programs. When you are
not in fullscreen or exit fullscreen, then the tabbing mode returns to
disabled so Ghostty can manage it.
2023-11-03 09:16:55 -07:00
Gregory Anders
6c340810a5 macos: fix tab labeling
Fixes a regression introduced in
https://github.com/mitchellh/ghostty/pull/772.
2023-11-03 07:40:56 -07:00
Gregory Anders
a844613a26 macos: always create new window on New Window action
Fixes: https://github.com/mitchellh/ghostty/issues/799
2023-11-03 07:34:17 -07:00
Mitchell Hashimoto
db309a0b61 macos: fix cascade points 2023-10-30 15:28:14 -07:00
Mitchell Hashimoto
b4c973cd23 macos: improved comments 2023-10-30 15:15:56 -07:00
Mitchell Hashimoto
ed1741730e macos: base config plumbed through 2023-10-30 11:53:05 -07:00
Mitchell Hashimoto
481d128405 macos: tab labels, detect window close 2023-10-30 09:50:52 -07:00
Mitchell Hashimoto
bee0f25d54 macos: new terminal view new tab/window 2023-10-30 09:06:24 -07:00
Mitchell Hashimoto
704c303cd1 macos: working on the new terminalmanager 2023-10-30 09:06:24 -07:00