369 Commits

Author SHA1 Message Date
Damien Mehala
1497e90f95 feat: add support for middle position in quick terminal
This update introduces the ability to launch the quick terminal
in the middle position.

Resolves #2494
2024-12-24 14:58:40 +01:00
Mitchell Hashimoto
9d6b9d78d8 macos: set NSAppearance on windowDidLoad
Fixes #3072

Previously, when `window-theme = auto`, the appearance was delayed
enough on the DispatchQueue that the window was already visible. This
would result in the window appearing with the wrong appearance before
switching to the correct one.

For annoying reasons, we can't set the NSApplication.shared.appearance
in `applicationDidFinishLaunching` because it results in a deadlock with
AppKit.

This commit moves to set the `NSWindow.appearance` in `windowDidLoad`
(and any config sync) to ensure that the appearance is set before the
window is visible.

This is probably the right solution anyways because this allows windows
with different background colors to each have their own distinct
appearance.
2024-12-22 19:33:01 -08:00
Mitchell Hashimoto
1861a391c8 config: quick terminal auto hide (#3059)
## Description

Introduce a setting allowing to customize the behavior of the quick
terminal when it loses focus. By default, the quick terminal will
automatically hide. However, you can now configure it to remain open by
setting `quick-terminal-autohide: false`.

Resolves #2558
2024-12-22 07:06:10 -08:00
Mitchell Hashimoto
1f468202d4 macos: add macos-icon-frame and some custom frame styles 2024-12-21 19:48:24 -08:00
Mitchell Hashimoto
adba2036e3 macos: custom app icon goes into About window 2024-12-21 19:31:30 -08:00
Mitchell Hashimoto
c4bec781b0 macos: colorized Ghostty icon begins! 2024-12-21 19:31:30 -08:00
Damien MEHALA
196af6f2ca config: quick terminal auto hide
Introduce a setting allowing to customize the behavior of the quick terminal
when it loses focus. By default, the quick terminal will automatically hide.
However, you can now configure it to remain open by setting
`quick-terminal-autohide: false`.

Resolves #2558
2024-12-22 01:08:47 +01:00
Mitchell Hashimoto
8f15f1a066 Make Ghostty release channel aware
Ghostty now has a release channel build configuration. Current valid
values are "tip" and "stable" but I imagine more will be added in the
future.

The release channel is inferred whether the version we specify with the
`-Dversion-string` build flag has a prerelease tag or not. If it does,
the release channel is "tip". If it doesn't, the release channel is
"stable".

This also adds a configuration to specify the release channel for
auto-updates for the macOS application.
2024-12-20 14:21:59 -08:00
Mitchell Hashimoto
330bbd0502 macos: add "Docs" button to the About window 2024-12-20 09:11:04 -08:00
Mitchell Hashimoto
c74966e07e build: change object story domain to ghostty.org 2024-12-20 08:58:46 -08:00
Mitchell Hashimoto
f384fd038b macos: trigger fullscreenDidChange on any fullscreen event
Fixes #2840
Related to #2842

This builds on #2842 by missing a key situation: when native fullscreen
is toggled using the menu bar items it doesn't go through our
`FullscreenStyle` machinery so we don't trigger fullscreen change
events.

This commit makes it so that our FullscreenStyle always listens for
native fullscreen change (even in non-native modes) to fire a fullscreen
did change event. This way we can always rely on the event to be fired
when fullscreen changes no matter what.
2024-12-01 11:37:04 -08:00
Mitchell Hashimoto
3bf1fdd7de macos: titlebar tabs can find titlebar container in fullscreen
Fixes #2850

In native fullscreen, the titlebar container is no longer part of our
NSWindow and is instead a separate window called
NSToolbarFullScreenWindow. We now search for this window when we are in
native fullscreen.
2024-11-29 10:35:02 -08:00
Mitchell Hashimoto
ba4185f6b7 macos: disable background opacity/blur in native fullscreen
See #2840
2024-11-27 08:35:13 -08:00
Mitchell Hashimoto
1aa77837eb macos: use correct title background if top surface 2024-11-21 14:20:31 -08:00
Mitchell Hashimoto
36a57826a6 macos: only color the titlebar of surfaces that border the top 2024-11-21 14:07:39 -08:00
Mitchell Hashimoto
7fb86a3c9c macos: listen for color change property to update window appearance 2024-11-21 13:37:54 -08:00
Mitchell Hashimoto
f722e30bf5 macos: terminal controller reacts to surface config changes 2024-11-21 12:46:46 -08:00
Mitchell Hashimoto
35fcb1a29b macos: change config access to evented, derived config like libghostty
Previously, we would access the `ghostty.config` object from anywhere.
The issue with this is that memory lifetime access to the underlying
`ghostty_config_t` was messy. It was easy when the apprt owned every
reference but since automatic theme changes were implemented, this isn't
always true anymore.

To fix this, we move to the same pattern we use internally in the core
of ghostty: whenever the config changes, we handle an event, derive our
desired values out of the config (copy them), and then let the caller
free the config if they want to. This way, we can be sure that any
information we need from the config is always owned by us.
2024-11-21 11:36:51 -08:00
Jon Parise
8a74b59a7e macos: struct attributes can be private 2024-11-15 22:47:38 -05:00
Jon Parise
de60382824 macos: further simplify using a @ViewBuilder 2024-11-15 22:43:21 -05:00
Jon Parise
2db43158a8 macos: formatting 2024-11-15 22:36:11 -05:00
Jon Parise
1807eabcb8 macos: prefer private View structs to functions 2024-11-15 22:33:27 -05:00
Jon Parise
6c3eaaf647 macos: support linkable AboutView properties
This allows us to enrich the build's commit property as a GitHub link.

This change also displays the property values using a monospaced font,
which I think looks a little nicer (especially the commit SHA).
2024-11-15 20:04:06 -05:00
Mitchell Hashimoto
4d9143f634 macos: use the pwd apprt action to set the proxy icon URL 2024-11-13 13:11:32 -08:00
Mitchell Hashimoto
9262cc5704 macos: restore window frame on cascadeTopLeft since macOS 15 moves it
Fixes #2565

This appears to be a bug in macOS 15. Specifically on macOS 15 when the
new native window snapping feature is used, `cascadeTopLeft(from: zero)`
will move the window frame back to its prior unsnapped position.

The docs for `cascadeTopLeft(from:)` explicitly say:

> When NSZeroPoint, the window is not moved, except as needed to constrain
> to the visible screen

This is not the behavior we are seeing on macOS 15. The window is on the
visible screen, we're using NSZeroPoint, and yet the window is still
being moved. This does not happen on macOS 14 (but its hard to say
exactly because macOS 14 didn't have window snapping).

This commit works around the issue by saving the window frame before
calling `cascadeTopLeft(from: zero)` and then restoring it afterwards
if it has changed.

I've also filed a radar with Apple for this issue.
2024-11-02 10:16:42 -07:00
Mitchell Hashimoto
63b11ceb5e macos: quick terminal set colorspace 2024-10-31 09:29:14 -07:00
Mitchell Hashimoto
30e95e4b9a Revert "macos: setup colorspace in base terminal controller"
This reverts commit e64b231248f68b2fd1e19d538d243b886d5284ff.
2024-10-31 09:28:08 -07:00
Mitchell Hashimoto
9dfe1fc7a0 Merge pull request #2553 from ghostty-org/push-zxvmpvrlxusn
macos: rectangle select only requires option + drag
2024-10-30 20:50:57 -04:00
Mitchell Hashimoto
c97c0858be macos: rectangle select only requires option + drag
Fixes #2537

This matches Terminal.app. iTerm2 requires cmd+option (our old
behavior). Kitty doesn't seem to support rectangle select or I couldn't
figure out how to make it work. WezTerm matches Terminal.app too.
Outside of terminal emulators, this is also the rectangular select
binding for neovim.
2024-10-30 20:47:24 -04:00
Mitchell Hashimoto
e64b231248 macos: setup colorspace in base terminal controller
Fixes #2519

This sets up the colorspace for terminal windows in the base controller.

This also modifies some of our logic so its easier for subclasses of
base controllers to specify custom logic when the configuration reloads,
since that's likely to be a common thing.
2024-10-30 20:35:13 -04:00
Mitchell Hashimoto
756755c052 comment 2024-10-30 16:45:55 -04:00
Marvin A. Ruder
b454f90a1a Replace check
* Check whether window is fullscreen before clamping
2024-10-30 21:42:25 +01:00
Marvin A. Ruder
7db9528aca fix(macOS): Fix visual glitch when switching between full-screen apps
* Check whether window is on active space before clamping

Fixes #2527
2024-10-30 19:56:01 +01:00
Mitchell Hashimoto
734c8cec55 Merge pull request #2490 from futurepaul/quick-terminal-improvements
macos: quick terminal animate duration
2024-10-25 20:48:40 -07:00
Mitchell Hashimoto
3c8fc86d6f small rename 2024-10-25 19:23:17 -07:00
Paul Miller
f4ba95b2c5 add quick-terminal-animate-duration option 2024-10-25 19:17:38 -05:00
Mitchell Hashimoto
50329e671c Merge pull request #2489 from hackrmomo/fix/aerospace-resizing-quick-terminal
Fix: aerospace no longer resizes quick terminal and instead treats it as float
2024-10-25 15:12:58 -07:00
Mitchell Hashimoto
28751ae5b8 Merge pull request #2485 from axdank/move_current_Tab
gui: add move_current_tab action
2024-10-25 14:15:16 -07:00
Mitchell Hashimoto
de5ec5d83e macos: make move_tab work 2024-10-25 11:54:07 -07:00
Mohammad Al-Ahdal
88119d0c17 default AXSubrole to .floatingWindow 2024-10-25 05:37:31 -06:00
Mohammad Al-Ahdal
5a1d09bcc6 Suggestion to use window identifier instead of trying to appease heuristics 2024-10-25 03:57:39 -06:00
Mitchell Hashimoto
582b8d039a Merge pull request #2492 from johnseth97/macos-proxy-icon-fix
Macos proxy icon fix
2024-10-24 21:08:15 -07:00
Mitchell Hashimoto
67bc9fa0bc macos: nuke the titlebar from orbit when hidden 2024-10-24 21:06:45 -07:00
johnseth97
e11fb62627 Fixed type conversion garbage 2024-10-24 23:47:34 -04:00
johnseth97
6c37fe2c26 Fixed conversion error between string and enum 2024-10-24 23:06:18 -04:00
johnseth97
f78ddabc15 refactored proxyIconURLDidChange to pwdDidChange 2024-10-24 23:01:54 -04:00
Mitchell Hashimoto
a651dbf3bf macos: fix goto last tab 2024-10-24 19:58:13 -07:00
johnseth97
fc094ee924 Fixed formatting 2024-10-24 22:15:31 -04:00
johnseth97
7301afa83e Removed uneeded code 2024-10-24 22:12:29 -04:00
johnseth97
8e223fdcd9 Reworked proxy icon, added config options. 2024-10-24 21:54:08 -04:00