49 Commits

Author SHA1 Message Date
Mitchell Hashimoto
7f6d2a44b8 macOS: fix cannot rebind super+up and super+down (#12245)
Fix: #11989
Cause identified to: ab352b5af9
Original PR: #10003
Problem: I don't think it is OK to hard code the keybind like this at
all. Ghostty's config is flexible enough to achieve this.
Proposal: Revert the above commit via this PR.

@yasuf @bo2themax
2026-04-12 13:16:06 -07:00
Lukas
bf6fd4abe5 macOS: add focusDidChange & sizeDidChange placeholders to OSSurfaceView 2026-04-12 14:23:46 +02:00
Lukas
90ea604a7c macOS: move searchState to OSSurfaceView 2026-04-12 14:23:46 +02:00
Lukas
a541e23120 macOS: move surface to OSSurfaceView 2026-04-12 14:23:46 +02:00
Lukas
1665755a93 macOS: move highlighted to OSSurfaceView 2026-04-12 14:23:46 +02:00
Lukas
2efe851cda macOS: move readonly to OSSurfaceView 2026-04-12 14:23:45 +02:00
Lukas
3834751aef macOS: move surfaceSize to OSSurfaceView 2026-04-12 12:08:56 +02:00
Lukas
7c83561f9e macOS: move focusInstant to OSSurfaceView 2026-04-12 12:07:22 +02:00
Lukas
56b505cbb0 macOS: move keyTables to OSSurfaceView 2026-04-12 12:06:28 +02:00
Lukas
19af8e9ce2 macOS: move progressReport to OSSurfaceView 2026-04-12 12:04:09 +02:00
Lukas
8b99c77bf7 macOS: update title comments 2026-04-12 12:02:59 +02:00
Lukas
619e12dc75 macOS: move hoverUrl to OSSurfaceView 2026-04-12 11:59:51 +02:00
Lukas
3936069297 macOS: move healthy and error to OSSurfaceView 2026-04-12 11:59:04 +02:00
Lukas
d38301bb9f macOS: move cellSize to OSSurfaceView 2026-04-12 11:58:04 +02:00
Lukas
46fef7718c macOS: move pwd to OSSurfaceView 2026-04-12 11:57:15 +02:00
Lukas
8bd1aba40a macOS: add shared OSSurfaceView 2026-04-12 11:54:16 +02:00
Toby She
30fdc8f4c8 macOS: fix cannot rebind super+up and super+down 2026-04-02 22:58:19 -04: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
9ec5672505 Revert "macOS: close search bar if needed when it loses focus (#11980)"
This reverts commit 20cfaae2e5, reversing
changes made to 3509ccf78e.
2026-04-01 19:21:42 +02:00
Lukas
a06350df9b macOS: close search bar if needed when it loses focus
This adds features like:
1. Clicking outside of SearchBar works like typing `escape`
2. Typing `tab` while search bar is focused also works like typing `escape`
2026-03-30 18:29:44 +02:00
Lukas
ad0c5fbec3 macOS: fix regression caused by 3ee8ef4f65 2026-03-26 19:58:18 +01:00
Lukas
d80d84862e macOS: fix mouse not working correctly in CommandPaletteView (#11658) 2026-03-19 19:26:58 +01: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
fe98f3884d macos: only show split grab handle when the mouse is near it
Fixes #11379

For this pass, I made it a very simple "within 20%" (height-wise) of the
split handle. There is no horizontal component. I want to find the right
balance between always visible (today mostly) to only visible on direct
hover, because I think it'll be too hard to discover on that far right
side.
2026-03-11 10:48:09 -07:00
Selman Kayrancioglu
6092c299d5 macos: reset mouse state on focus loss to prevent phantom drag
Fixes phantom mouse drag/selection when switching splits or apps.
The suppressNextLeftMouseUp flag and core mouse click_state were not
being reset on focus transitions, causing stale state that led to
unexpected drag behavior.

- Reset suppressNextLeftMouseUp in focusDidChange when losing focus
- Defensively reset the flag when processing normal clicks
- Reset core mouse.click_state and left_click_count on focus loss
2026-03-10 09:54:08 -07:00
Tim Culverhouse
3ee8ef4f65 macos: suppress split-focus click mouse reports
Amp-Thread-ID: https://ampcode.com/threads/T-019cb9fe-b11b-753f-99e7-8ecc52b73ec4
Co-authored-by: Amp <amp@ampcode.com>
2026-03-04 12:43:51 -06:00
Jeffrey C. Ollie
ea5b07d20f core: add tests for ghostty.h
* ensure that `ghostty.h` compiles during basic Zig tests
* ensure that non-exhaustive enums are kept synchronized between
  `ghostty.h` and their respective Zig counterpart.
* adjust some enums that varied from established conventions
2026-02-27 09:22:23 -06:00
Mitchell Hashimoto
a5909dfa1d macos: command finished notifications always show up 2026-02-26 13:40:41 -08:00
Martin Emde
2842b18a3f Only show drag handle on hovered surface 2026-02-23 12:04:07 -08:00
Jon Parise
629a656e53 macos: swiftlint 'vertical_whitespace' rule 2026-02-19 18:58:28 -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
6052f664cf macos: swiftlint 'opening_brace' rule 2026-02-19 18:53:13 -05:00
Jon Parise
b10dcc9629 macos: swiftlint 'legacy_constructor' rule 2026-02-19 18:43:22 -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
786bad9774 macos: swiftlint 'colon' rule 2026-02-19 18:32:44 -05:00
Mitchell Hashimoto
fb8cb162ce macos: Ghostty.Inspector 2026-01-31 09:22:26 -08:00
Tim Culverhouse
5ee56409c7 macos: support mouse buttons 8/9 (back/forward)
Add support for mouse buttons 4-11 in the macOS app. Previously only
left, right, and middle buttons were handled. Now otherMouseDown/Up
events properly map NSEvent.buttonNumber to the corresponding Ghostty
mouse button, enabling back/forward button support.

Fixes: https://github.com/ghostty-org/ghostty/issues/2425
Amp-Thread-ID: https://ampcode.com/threads/T-019bd74e-6b2b-731d-b43a-ac73b3460c32
Co-authored-by: Amp <amp@ampcode.com>
2026-01-19 11:59:50 -06:00
Mitchell Hashimoto
f34c69147a macos: use the new binding flags information value to trigger menu 2026-01-09 07:13:14 -08: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
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
Ivan Buiko
c89627fe75 macOS: Add menu shortcut handling in macOS key event processing
Allow menu bar to flash for shortcuts and handle key equivalents before
checking for Ghostty key bindings
2026-01-01 12:47:16 -08:00
Jon Parise
12024ed831 macos: simplify .keyDown guard condition
This condition is more naturally expressed as a `guard`.
2026-01-01 10:17:48 -05:00
Mitchell Hashimoto
c164e3bc02 macos: fix messy rebase 2025-12-29 07:13:25 -08:00
Mitchell Hashimoto
485b861342 macos: drag preview is an image of the surface 2025-12-29 06:55:00 -08:00
Mitchell Hashimoto
ab232b3060 macos: move Ghostty surface view into dedicated folder 2025-12-29 06:54:59 -08:00