Commit Graph
215 Commits
Author SHA1 Message Date
Lukas e2832ae1fe macOS: get latest TerminalEntity's kind, title & pwd
This fixes these being wrong after creating a terminal window for the first time.
2026-06-13 20:56:34 +02:00
Claude Opus 4.7 eb5c1c7220 fix(macos): mark Swift os.Logger interpolations as public 2026-05-31 16:35:11 +02:00
Lukas 00a989774e macOS: add review windows when quitting
Inspired by Terminal.app
2026-05-19 20:01:32 +02:00
Lukas 1df7a5d3f3 macOS: update keybind for end_search 2026-04-27 18:55:31 +02:00
Lukas 231f6f4c75 macOS: move the restoration logs 2026-04-25 21:06:20 +02:00
Lukas 7c91cef28d config: use Config to check key binding instead of App
Previously `ghostty_app_key_is_binding` (unlike Surface) is just using `config.keybind` to check whether a KeyEvent is in the set or not.

After this, I can add unit tests for keybinding more easily, with dummy configs.
2026-04-24 18:26:56 +02:00
Mitchell Hashimoto 62fdd885e0 macOS: open preferred config if exists (#12321)
This helps developers like me to use a separate config for debugging
(which is already supported by the environment variable
`GHOSTTY_CONFIG_PATH`).

I can already use the local scheme to load a debugging config file, but
when opening the config file through Ghostty, it will still open the
default config.

This changes doesn't affect the release build, since `configPath` is
only set in the DEBUG build.
2026-04-21 09:23:29 -07:00
Lukas c7a73076e9 macOS: fix App Icon update in Finders
Looks like  `NSWorkspace.shared.setIcon` can only be called from the main App, DockTilePlugin is sandboxed and doesn't have the permission to `file-write-finderinfo`.

It works fine in debug, but not in release. This fixes #11489, #11290
2026-04-20 12:56:55 +02:00
Lukas 9bad9365b0 macOS: open preferred config if exists 2026-04-17 15:29:29 +02:00
Lukas 858e856e2e macOS: fix shortcuts not showing on menu item for scroll_to_selection and search_selection
Incorrect link after 9b6a3be993 and 7d0157e69a
2026-04-14 19:21:16 +02:00
Kay Leung e390937867 macos: fix badge permission
The previous version requested general notification permissions but omitted the `.badge` option. Because the initial request was granted, `settings.authorizationStatus` returns `.authorized`, leading the app to believe it has full notification privileges when it actually lacks the authority to update the dock icon badge.
2026-04-06 05:19:25 +08:00
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