20 Commits

Author SHA1 Message Date
Mitchell Hashimoto
984d123fe4 macos: support configuration via CLI arguments
This makes it so `zig build run` can take arguments such as
`--config-default-files=false` or any other configuration. Previously,
it only accepted commands such as `+version`.

Incidentally, this also makes it so that the app in general can now take
configuration arguments via the CLI if it is launched as a new instance
via `open`. For example:

    open -n Ghostty.app --args --config-default-files=false

This previously didn't work. This is kind of cool.

To make this work, the libghostty C API was modified so that
initialization requires the CLI args, and there is a new C API to try to
execute an action if it was set.
2025-07-05 21:31:23 -07:00
Jon Parise
074edd3065 macos: disable auto-updates for local builds
The auto-update prompt isn't useful for local (source) builds. Disable
it by default by setting Sparkle's SUEnableAutomaticChecks Info.plist
key to NO (false) for all build configurations.

We then selectively re-enable it by deleting that Info.plist key from
our release workflows. We delete the key instead of setting its value to
YES (true) to give us Sparkle's default behavior of prompting the user
to enable update checks on the second application launch. (YES tells
Sparkle to skip that prompt and silently enable update checks.)

See also: https://sparkle-project.org/documentation/customization/
2024-12-29 15:48:59 -05:00
Mitchell Hashimoto
6508fec945 Revert "macos: disable auto-updates for local (source) builds (#3273)"
This reverts commit b39850fd8b463f78c6fb450cd7a59e43bdf4b622, reversing
changes made to 64ea3a1a29677ca5f094f8058c40c549bb741bc5.
2024-12-29 09:22:54 -08:00
Mitchell Hashimoto
b39850fd8b macos: disable auto-updates for local (source) builds (#3273)
The auto-update prompt isn't useful for local (source) builds so disable
both update checks and automatic downloads for the Debug and Release
configurations.

Fixes #3179
2024-12-29 09:20:07 -08:00
Finn Voorhees
8cb13bcfad Add MDItemKeywords 2024-12-28 11:21:11 -05:00
Jon Parise
2c3847c9af macos: disable Sparkle checks in Debug and Release
This approach uses Xcode's Info.plist preprocessing to conditionally set
`SUEnableAutomaticChecks=false` for the Debug and Release build schemes.
It is unset for the ReleaseLocal scheme.

When this Info.plist key is explicitly set to false (as it is for these
build schemes), we disable auto-updates at runtime. Otherwise, we apply
the behavior defined by our "auto-update" configuration.
2024-12-27 08:16:18 -05:00
Mitchell Hashimoto
0abd4ea8a2 ci: release tag workflow
This adds a new workflow for building and releasing _tagged versions_
of Ghostty. The workflow is triggered automatically by new tags in the
format of `vX.Y.Z` but can also be manually triggered by running the
workflow from the GitHub Actions UI.

Release artifacts are uploaded to a completely separate R2 bucket
with its own access policy, retention, API keys, and so on.

There is currently no way to switch between "channels" in the macOS
app. I will follow up with a separate commit to add this feature.
2024-12-20 13:02:05 -08:00
Mitchell Hashimoto
ea46cb19e6 macos: use a different bundle identifier for debug builds
This is necessary to avoid conflicts with application data such
as permissions and preferences.
2024-09-29 16:16:55 -07:00
Matt Robenolt
9b233b2d47 macos: Declare Ghostty as a Shell
tbh I'm not exactly sure what this does, but Kitty/Hyper/iTerm2 all
declare this.

https://github.com/kovidgoyal/kitty/blob/master/setup.py#L1419-L1422
https://gitlab.com/gnachman/iterm2/-/blob/master/plists/release-iTerm2.plist#L120-127
https://github.com/vercel/hyper/blob/master/electron-builder.json#L72-L79

I'm trying to get Ghostty to work correctly with OrbStack: https://github.com/orbstack/orbstack/issues/1012

And this stood out as the biggest difference.
2024-05-21 11:00:03 -07:00
Qwerasd
51f53aa9bf Added macOS file open handler 2024-01-16 16:26:21 -05:00
Mitchell Hashimoto
c352d88afd ci: generate appcast, upload it 2023-12-18 21:18:52 -08:00
Mitchell Hashimoto
68a23e786d macos: put build numbers back into info.plist, other metadata
This adds more metadata back into the Info.plist for a build. This
metadata is used with the About window. The reason I want the build
number back is so that we have a monotonically increasing number to do
self-updating with (i.e. Sparkle).
2023-12-18 18:56:34 -08:00
Mitchell Hashimoto
a040e807e8 macos: implement service provider 2023-10-04 12:11:23 -07:00
Mitchell Hashimoto
5018bd42c8 macos: localize the permission strings 2023-10-04 11:22:07 -07:00
Mitchell Hashimoto
6249621d71 macos: support drag and drop with no windows 2023-10-03 22:03:04 -07:00
Mitchell Hashimoto
bd528f5c11 macos: set the proper env var 2023-09-20 12:43:35 -07:00
Mitchell Hashimoto
cdbf16e13b macos: set env var for app bundle to detect app launch vs CLI 2023-09-20 11:10:46 -07:00
Mitchell Hashimoto
423e55ce0f macos: change executale name to "ghostty" (lowercase)
This way we can also put this on the PATH and use it as a CLI...
2023-09-20 10:13:12 -07:00
Thorsten Ball
39055ebf40 macOS: explicitly name the NSMainNibFile in plist
According to [this answer][0] here and [this blogpost][1], if the
`NSMainNibFile` is not specified in the `*.plist` file, then
`NSApplicationMain` will look through the bundle to get the first nib
file it finds.

I like the explicitness of naming it and it probably also saves a
miniscule amount of CPU/IO when we can skip finding the file.

[0]: https://stackoverflow.com/questions/42886400/how-does-nsapplicationmain-find-the-main-nib-file
[1]: https://jameshfisher.com/2017/03/20/how-is-mainmenu-xib-loaded/
2023-08-07 19:48:04 +02:00
Mitchell Hashimoto
1d14b121c0 renderer: do not draw cursor cell inversion if we don't draw the cursor
We previously used the "screen.viewportIsBottom" check but this is
always true since awhile back since we copy only the viewport now. A
cleaner check really is that we only track the cursor cell if we're even
drawing the cursor.
2023-05-25 21:41:43 -07:00