Commit Graph

201 Commits

Author SHA1 Message Date
Mitchell Hashimoto
dcb7c9a4b8 macos: show the notification count number in the badge 2026-02-26 10:21:35 -08:00
Mitchell Hashimoto
5389fdfbaf macos: lint 2026-02-26 10:14:22 -08:00
Mitchell Hashimoto
454a89e011 macos: clean up badge request state 2026-02-26 10:10:42 -08:00
Mitchell Hashimoto
3aca722415 macos: further simplication of AppDelegate bell state 2026-02-26 09:52:26 -08:00
Mitchell Hashimoto
79ca4daea6 macos: try to clean up Appdelegate combine mess 2026-02-26 09:47:17 -08:00
Mitchell Hashimoto
ea8bf17df8 macos: use combine to coalesce bell values 2026-02-26 09:39:23 -08:00
Mitchell Hashimoto
304823d560 macos: just some textual cleanup 2026-02-25 08:58:09 -08:00
Noah Gregory
58acab6c7d Merge branch 'ghostty-org:main' into fix-tabbing-from-tab-overview 2026-02-24 20:24:18 -05:00
Noah Gregory
dd4e36f921 macOS: fix crash when adding tab from tab overview 2026-02-24 18:08:45 -05:00
Lukas
c72788894e ci: fix linting and delete non-useful tests 2026-02-24 10:13:24 +01:00
Mitchell Hashimoto
2c28c27ca5 moving lots of files, removing unused stuff 2026-02-24 08:58:15 +01:00
Lukas
45525a0a85 macOS: use NSDockTilePlugIn to update app icons 2026-02-24 08:58:14 +01:00
Jon Parise
2d6fa92d78 macos: swiftlint 'for_where' rule 2026-02-20 19:42:48 -05:00
Jon Parise
3d3ea3fa59 macos: swiftlint 'no_fallthrough_only' rule
This rule is generally trying to be helpful, but it doesn't like a few
places in our code base where we're intentionally listing out all of the
well-known cases. Given that, just disable it.

https://realm.github.io/SwiftLint/no_fallthrough_only.html
2026-02-20 13:01:30 -05:00
Jon Parise
9bae26ab45 macos: swiftlint 'orphaned_doc_comment' rule 2026-02-19 19:06:09 -05:00
Jon Parise
b532cd55d6 macos: swiftlint 'trailing_whitespace' rule 2026-02-19 18:56:43 -05:00
Jon Parise
33dce8511e macos: swiftlint 'trailing_semicolon' rule 2026-02-19 18:56:25 -05:00
Jon Parise
25b38b291e macos: swiftlint 'private_over_fileprivate' rule 2026-02-19 18:55:12 -05:00
Jon Parise
6052f664cf macos: swiftlint 'opening_brace' rule 2026-02-19 18:53:13 -05:00
Jon Parise
9287a61920 macos: swiftlint 'implicit_optional_initialization' rule 2026-02-19 18:36:38 -05:00
Jon Parise
56d67ce88f macos: swiftlint 'control_statement' rule 2026-02-19 18:34:37 -05:00
Jon Parise
a8903c1bb1 macos: swiftlint 'comment_spacing' rule 2026-02-19 18:34:02 -05:00
Jon Parise
303c9142dc macos: improve "Set Default Terminal"
Switch to using the existing UTType.unixExecutable constant for this
operator, which also lets us remove a failure path. Also, use the
completion-based setDefaultApplication() variant to handle errors.

This simplifies the code enough that we don't need the additional
NSWorkspace+Ghostty extension functions.
2026-02-18 11:47:30 -05:00
Mahno Kropotkinvich
aee80d208d add "Set Ghostty as Default Terminal App" on macOS 2026-02-17 20:52:49 -08:00
Jon Parise
df6feba417 macos: rename shellQuoted() to Ghostty.Shell.quote()
We already had an established Ghostty.Shell namespace (previously a
struct; now a more idiomatic enum), and locating these functions next to
each other makes it clearer how they relate to one another.
2026-02-16 15:27:57 -05:00
Jon Parise
1ff0dd821f macos: quote input strings used for shell commands
When we're building an input string that's explicitly meant to be used
as a shell command, quote (escape) it using the same logic as Python's
shlex.quote function.

This specifically addresses issues we've seen when open(1)'ing Ghostty
with filename arguments that contain spaces.
2026-02-05 09:21:37 -05:00
Lars
4f667520fa macOS: GhosttyUITests 2026-01-20 09:15:14 -08:00
Jon Parise
1537590a5f macos: cycle through our icons in the About view
Clicking on the icon immediately advances to the next one. Hovering on
the icon pauses the automatic cycling, and the "help" tooltip displays
the icon's configuration name (for `macos-icon`).
2026-01-12 15:20:14 -05:00
Mitchell Hashimoto
7d0157e69a macOS: add Cmd+J "Jump to Selection" menu item and default binding
This matches other built-in macOS apps like Terminal, Notes, Safari. We
already had the binding, just needed to create the menu.

https://ampcode.com/threads/T-019b956a-f4e6-71b4-87fa-4162258d33ff
2026-01-06 14:30:11 -08:00
Mitchell Hashimoto
05a41c7772 macos: clean up menu 2026-01-06 14:20:34 -08:00
Mitchell Hashimoto
8e28f58b42 rename the selection search binding, unify into start_search action 2026-01-06 14:10:42 -08:00
Aaron Ruan
9b6a3be993 macOS: Selection for Find feature
Adds the `selection_for_search` action, with Cmd+E keybind by default.
This action inputs the currently selected text into the search
field without changing focus, matching standard macOS behavior.
2026-01-06 22:21:55 +08:00
Mitchell Hashimoto
5245757875 macos: all sorts of cleanups 2025-12-29 06:55:01 -08:00
Mitchell Hashimoto
1dd8e3ef4a macos: add GhosttyDelegate for global operations 2025-12-29 06:55:00 -08:00
Zongyuan Li
88e471e015 fix(iOS): fix iOS app startup failure
Fixes #7643

This commit address the issue with 3 minor fixes:
1. Initialize ghostty lib before app start, or global allocator will
   be null.
2. `addSublayer` should be called on CALayer object, which is the
   property 'layer' of UIView
3. According to apple's [document](https://developer.apple.com/documentation/metal/mtlstoragemode/managed?language=objc),
   managed storage mode is not supported by iOS. So always use shared
   mode.

FYI, another [fix](https://github.com/mitchellh/libxev/pull/204) in libxev
is also required to make iOS app work.
2025-12-26 18:53:45 +08:00
Mitchell Hashimoto
86a0eb1a75 macos: hide tab overview on escape
This hides the macOS tab overview when the `escape` key is pressed.

Our solution is a bit blunt here and I don't think its right. I think we
have a first responder problem somewhere but I haven't been able to find
it and find the proper place to implement `cancel` (or equivalent) to
hide the overview. I tried implementing `cancel` in all the places I
expect the responder chain to go through but none worked.

For now let's do this since it is pretty tightly scoped!
2025-12-19 07:13:47 -08:00
Jake Nelson
377bcddb46 fix(macOS): re-apply icon after app update 2025-12-18 12:55:49 +11:00
Lukas
d680404fae macOS: save&restore quick terminal state 2025-12-16 08:51:58 -08:00
Mitchell Hashimoto
173d8efd90 macos: add to context menu 2025-12-12 13:55:03 -08:00
Mitchell Hashimoto
ceb1b5e587 macos: add a read-only menu item in View 2025-12-12 13:53:08 -08:00
Mitchell Hashimoto
7b48eb5c62 macos: add change tab title to menu 2025-12-11 16:16:12 -08:00
Lukas
94f88c8b54 macOS: fix toggle_visibility behaviour with tabbed windows
This fixes regression of #5690, which kind of comes from #9576. 05b42919d5 (before #9576) has weird behaviours too, restored windows are not properly focused. With this pr, we only order `selectedWindow` front so we won't mess up with its selection state and the order of the tab group.
2025-11-28 10:14:07 +01:00
Mitchell Hashimoto
7835ad0ea4 macos: more menu items 2025-11-26 08:50:05 -08:00
Mitchell Hashimoto
3f7cfca4b4 macos: add find menu item 2025-11-26 08:50:05 -08:00
Lukas
6f75cc56f6 macOS: Only change the icon if needed
Fixes #9666
2025-11-22 16:48:39 +01:00
Lukas
bcb5112b24 macOS: restore visiblity state when hiding quick terminal 2025-11-13 11:30:43 +01:00
Lukas
7e3aba7c99 macOS: remove readyToInstall state in update capsule
There is a sparkle-related 'issue' with the previous implementation. When you download/install in the `updateAvailable` state, if you don't install it, then check the updates again. Sparkle loses its downloaded stage in the delegate (it's normal when I use the sparkle source code). This time, when you click install in the `updateAvailable` state, it just uses the previous downloaded package and starts to install, without calling `showReady(toInstallAndRelaunch:)`.

I think removing `readyToInstall` in our customed ui, will reduce one step to install an update for most of the users out there, which makes sense, since the current package is pretty small, only takes a few seconds to download for a normal network, and they intended to install this update.
2025-11-09 20:24:24 +01:00
Lars
7472fb7732 macOS: set the macos-icon from a separate thread 2025-11-05 12:27:35 +01:00
Dusk
27b0978cd5 macos: use system beep for bell (#9339)
This seems pretty straightforward. I've tested it and it does what I'd
expect it to do.

Fixes #9338
2025-10-26 03:24:52 +00:00
Mitchell Hashimoto
8f1a014afd macos: clean up the "installing" update state (#9170)
This includes multiple changes to clean up the "installing" state:

- Ghostty will not confirm quit, since the user has already confirmed
they want to restart to install the update.
- If termination fails for any reason, the popover has a button to retry
restarting.
- The copy and badge symbol have been updated to better match the
reality of the "installing" state.

<img width="1756" height="890" alt="CleanShot 2025-10-12 at 15 04 08@2x"
src="https://github.com/user-attachments/assets/1b769518-e15f-4758-be3b-c45163fa2603"
/>

AI written:
https://ampcode.com/threads/T-623d1030-419f-413f-a285-e79c86a4246b fully
understood.
2025-10-12 15:20:26 -07:00