66 Commits

Author SHA1 Message Date
Mitchell Hashimoto
8d395c094b macos: set title of terminal window immediately if configured
Fixes #5934 for macOS

If a `title` config is set, this change sets the title immediately on
windowDidLoad to ensure that the window appears with the correct title
right away.

If there is any reason to set another title, the `set_title` apprt
action will come on another event loop tick (due to our usage of
notifications) but that's okay since that's already how it works. This
is just to say that setting this here won't break any shell integration
or anything.
2025-03-02 13:27:40 -08:00
Mitchell Hashimoto
afb154ee5d macos: store default size as computed property 2025-02-28 14:51:56 -08:00
Mikhail Borisov
8838ebf02a Refactor to use height/width from ghostty configuration 2025-02-28 14:17:46 -08:00
Aaron Ruan
5a5478abe1 feat: respect maximize config on macOS
Signed-off-by: Aaron Ruan <i@ar212.com>
2025-02-27 15:10:39 -08:00
Albert Dong
d7a82f212a Add setting to hide icon from dock/cmd-tab 2025-02-15 10:45:27 -08:00
Mitchell Hashimoto
ac7aa757bd macos: add padded-notch option for macos-non-native-fullscreen
Finishes #378
Supercedes #4159

This adds a new enum value for `macos-non-native-fullscreen`:
`padded-notch`. This value will add padding to the top of the window to
account for the notch on applicable devices while still hiding the
menu.

This value is preferred over "visible-menu" by some people because for
screens without a notch, the window will take up the full height.

The plan in the future is that we may color the padded area when a notch
is present. In this commit it appears as transparent.
2025-02-13 20:27:42 -08:00
Mitchell Hashimoto
e854b38872 cli: allow renaming config fields to maintain backwards compatibility
Fixes #4631

This introduces a mechanism by which parsed config fields can be renamed
to maintain backwards compatibility. This already has a use case --
implemented in this commit -- for `background-blur-radius` to be renamed
to `background-blur`.

The remapping is comptime-known which lets us do some comptime
validation. The remap check isn't done unless no fields match which
means for well-formed config files, there's no overhead.

For future improvements:

- We should update our config help generator to note renamed fields.
- We could offer automatic migration of config files be rewriting them.
- We can enrich the value type with more metadata to help with
  config gen or other tooling.
2025-01-23 14:16:37 -08:00
Mitchell Hashimoto
a5853c4de8 macos: respect the "auto" window decoration setting 2025-01-16 14:03:04 -07:00
Leah Amelia Chen
4e0d9b1b27 gtk(wayland): implement server-side decorations 2025-01-14 09:57:59 -08:00
Qwerasd
fca336c32d Metal: blend in Display P3 color space, add option for linear blending
This commit is quite large because it's fairly interconnected and can't
be split up in a logical way. The main part of this commit is that alpha
blending is now always done in the Display P3 color space, and depending
on the configured `window-colorspace` colors will be converted from sRGB
or assumed to already be Display P3 colors. In addition, a config option
`text-blending` has been added which allows the user to configure linear
blending (AKA "gamma correction"). Linear alpha blending also applies to
images and makes custom shaders receive linear colors rather than sRGB.

In addition, an experimental option has been added which corrects linear
blending's tendency to make dark text look too thin and bright text look
too thick. Essentially it's a correction curve on the alpha channel that
depends on the luminance of the glyph being drawn.
2025-01-13 13:50:29 -08:00
Soh Satoh
e2523c25cb Add quick-terminal-space-behavior option 2025-01-08 11:02:19 -08:00
Christian Schneider
a670836d7a Remove outdated comment 2025-01-04 20:18:00 -08:00
Christian Schneider
da80531c22 Implement configuration option split-divider-color for macOS 2025-01-04 20:18:00 -08:00
Mitchell Hashimoto
7eb6b29d4c macos: make auto-update optional (#4436)
When unset, we use Sparkle's default behavior, which is based on the
user's preference stored in the standard user defaults.

The rest of the previous behavior is preserved:
- When SUEnableAutomaticChecks is explicitly false, auto-updates are
disabled.
- When 'auto-update' is set, use its value to set Sparkle's auto-update
behavior.

Fixes #4433
2025-01-02 13:38:15 -08:00
Mitchell Hashimoto
29b96be84f tweaks to window position 2025-01-02 13:18:53 -08:00
Adam Wolf
f9250e28b5 chore: rename window-position-{x,y} to window-initial-position-{x,y} 2025-01-02 12:58:40 -08:00
Adam Wolf
200d0d642b macos: handle setting initial window position when window is created 2025-01-02 12:58:40 -08:00
Jon Parise
713dd24ab9 macos: make auto-update optional
When unset, we use Sparkle's default behavior, which is based on the
user's preference stored in the standard user defaults.

The rest of the previous behavior is preserved:
- When SUEnableAutomaticChecks is explicitly false, auto-updates are
  disabled.
- When 'auto-update' is set, use its value to set Sparkle's auto-update
  behavior.
2025-01-02 15:53:01 -05: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
Troels Thomsen
0611ca414f Divide red component of unfocused split fill color 2024-12-22 09:59:15 +01:00
Mitchell Hashimoto
1f468202d4 macos: add macos-icon-frame and some custom frame styles 2024-12-21 19:48:24 -08:00
Mitchell Hashimoto
abf713feec macos: support the macos-icon configurations 2024-12-21 19:31:30 -08:00
Mitchell Hashimoto
298d6194f4 config: change color to a defined C struct for libghostty 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
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
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
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
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
495925355a config: make the proxy icon documentation more detailed 2024-10-24 20:56:45 -07:00
johnseth97
c3efda93f4 Converted config declaration to an enum 2024-10-24 23:02:50 -04:00
johnseth97
8e223fdcd9 Reworked proxy icon, added config options. 2024-10-24 21:54:08 -04:00
Mitchell Hashimoto
70acb0d76e macos: clamp window size to screen size on screen parameter changes
Fixes #2462

This sets up a listener for screen parameter changes. This only triggers
when a screen is added, removed, or a parameter such as its resolution
changes. This doesn't trigger when a window is simply moved from one
screen to another.

On parameter change, we ensure that the window is within the bounds of
the screen. As an exception, if the window was previously already
outside the bounds of the screen, we don't move it back in.
2024-10-19 10:13:16 -07:00
Mitchell Hashimoto
a4e14631ef config: richer diagnostics for errors
Rather than storing a list of errors we now store a list of
"diagnostics." Each diagnostic has a richer set of structured
information, including a message, a key, the location where it occurred.

This lets us show more detailed messages, more human friendly messages, and
also let's us filter by key or location. We don't take advantage of
all of this capability in this initial commit, but we do use every field
for something.
2024-10-18 08:11:11 -07:00
Mitchell Hashimoto
8994a8c627 macos: implement key sequence UI 2024-10-08 21:58:53 -07:00
Lucy Davinhart
a109b8d755 Implements initial-window=false for macOS
Closes https://github.com/ghostty-org/ghostty/issues/2361
2024-10-03 19:09:37 +01:00
Mitchell Hashimoto
ba9ae0c0be macos: only get fullscreen mode on AppKit 2024-09-30 10:37:33 -07:00
Mitchell Hashimoto
5f9d4f9733 macos: fullscreen=true with non-native fullscreen works
Fixes #1377
2024-09-30 10:02:50 -07:00
Mitchell Hashimoto
4f9d49b380 macos: handle multiple monitors properly 2024-09-28 20:52:22 -07:00
Mitchell Hashimoto
bcdbb5899b macos: only define quick terminal configs for AppKit 2024-09-28 19:14:27 -07:00
Mitchell Hashimoto
11d5ec7dc1 config: support quick terminal position 2024-09-28 18:42:25 -07:00
Mitchell Hashimoto
df5cd719d6 macos: rename overlay config to indication 2024-09-19 20:00:46 -07:00
Mitchell Hashimoto
a513a02328 config: config to disable auto secure input and secure input overlay 2024-09-19 17:20:54 -07:00
Mitchell Hashimoto
359272a5f5 macos: start Sparkle after loading config 2024-09-10 21:54:40 -07:00
hanna
fd9d38481b refactor: attempted autoupdate configuration 2024-09-10 21:40:17 -07:00
pnodet
7ff9af1520 style(macos): cleanup trailing spaces 2024-08-21 21:53:09 +02:00
Mitchell Hashimoto
9cf247bb3e macos: implement resize overlay
Implements the resize overlay configurations completely.
2024-08-10 20:17:33 -07:00
Cameron Dart
97bb595505 macos: add to config 2024-06-10 16:06:57 -07:00