204 Commits

Author SHA1 Message Date
Lukas
18f2702225 macOS: fix Find Next/Previous button in the menu bar is not working as expected 2026-04-02 20:31:31 +02:00
Lukas
de8139bbc3 macOS: move MenuShortcutManager to a separate file 2026-03-30 16:10:06 +02:00
Lukas
1845dd26b6 macOS: extract menu shortcut syncing into MenuShortcutManager 2026-03-30 16:09:21 +02:00
Lukas
65cd31dc79 macOS: add NormalizedMenuShortcutKeyTests 2026-03-30 15:47:07 +02:00
Lukas
d6dfaf28fe macOS: support injecting temporary defaults when testing 2026-03-12 13:16:55 +01:00
Mitchell Hashimoto
8093695055 macos: only run key equivalents for Ghostty-owned menu items
Fixes #11396

Track menu items populated from Ghostty keybind actions and only trigger
those from SurfaceView performKeyEquivalent. This avoids app-default
shortcuts such as Hide from pre-empting explicit keybinds.
2026-03-11 19:59:56 -07:00
Mitchell Hashimoto
98ad1d955c use proper type for optional path 2026-03-03 19:53:15 -08:00
Alaa Ali
b215291914 macos: implement audio bell support with bell-audio-path
Extends the macOS bell implementation to support the `audio` bell
feature by playing a user-specified audio file via NSSound.

Previously, macOS only supported the `system` feature (NSSound.beep()).
This change adds support for:
- `audio` bell feature: plays the file at `bell-audio-path` using
  NSSound, respecting the `bell-audio-volume` setting
- Adds `cval()` to the `Path` type so it can be returned via the C API

Also removes the "(GTK only)" restriction from `bell-audio-path` and
`bell-audio-volume` documentation, as these options now work on macOS.

Example config:
  bell-features = audio
  bell-audio-path = /System/Library/Sounds/Glass.aiff
  bell-audio-volume = 0.8
2026-03-03 23:00:50 +01:00
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
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