Commit Graph

1800 Commits

Author SHA1 Message Date
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
5c5f645b61 macOS: support reloading temporary config for testing 2026-03-30 15:47:07 +02:00
Nicholas Ochoa
3f6683df02 macos: add support for middle-click tab close 2026-03-29 15:19:35 -07:00
Lukas
ad0c5fbec3 macOS: fix regression caused by 3ee8ef4f65 2026-03-26 19:58:18 +01:00
Lukas
95ee878904 macOS: add test case for search bar focus change 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
ac3893d0b9 macOS: Add command palette tests 2026-03-19 19:26:57 +01:00
Lukas
50113ab678 macOS: add mouse state tests for #11276
It will fail on 4e24adf71 and success after #11276
2026-03-19 19:02:13 +01:00
Mitchell Hashimoto
f3ac604fff macos: select tab applescript command should not activate application (#11459)
Related to #11457
2026-03-13 08:53:53 -07:00
Mitchell Hashimoto
4c4e83784c macos: new tab applescript command should not activate application
Related to #11457
2026-03-13 08:49:22 -07:00
Lukas
5c51603b0b chore: make ci happy 2026-03-12 20:02:23 +01:00
Lukas
07bc888682 macOS: fix window position when dragging split into a new window 2026-03-12 19:54:41 +01:00
Lukas
3022aa05ea macOS: add test cases for drag-split 2026-03-12 19:54:12 +01:00
Lukas
d6d6fe4e58 macOS: update window cascading
Make it smaller and add comparisons between y values
2026-03-12 18:58:37 +01:00
Lukas
5e3866381b macOS: fix window cascading for the second window 2026-03-12 18:32:04 +01:00
Lukas
ea262cdd34 macOS: fix window cascading for 3rd+ window 2026-03-12 18:32:04 +01:00
Lukas
77c2acf843 macOS: add test case for window cascading without moving the window 2026-03-12 18:32:04 +01:00
Lukas
08107d342a macOS: we don't need initialFrame anymore 2026-03-12 15:42:29 +01:00
Lukas
4f849a1512 macOS: fix window position for the very first window 2026-03-12 15:42:29 +01:00
Lukas
c399812036 macOS: add test case for positioning the very first window 2026-03-12 15:42:28 +01:00
Lukas
d6dfaf28fe macOS: support injecting temporary defaults when testing 2026-03-12 13:16:55 +01:00
Mitchell Hashimoto
ab269e2c79 config: add progress-style option (#11289)
Adds progress-style config to control OSC 9;4 progress bar visibility.
Defaults to true, set false to hide.

Fixes #11241

AI Disclosure: Claude Code (Opus 4.6) used for codebase exploration,
code review, and testing assistance. All code written and reviewed by
hand.
2026-03-11 20:46:59 -07: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
Michal Olechowski
84d48d1c6a config: add progress-style option
Add option to disable OSC 9;4 ConEmu progress bars via config.

Fixes #11241
2026-03-12 01:33:25 +01: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
Mitchell Hashimoto
19e5053b28 macos: only show the grab handle in fullscreen if there are splits (#11381)
Fixes #11376
2026-03-11 10:08:25 -07:00
Mitchell Hashimoto
12bc1e7860 macos: only show the grab handle in fullscreen if there are splits
Fixes #11376
2026-03-11 10:02:09 -07:00
Lukas
596d502a75 macOS: restore window frame under certain conditions 2026-03-11 17:45:10 +01:00
Lukas
45d360dc68 macOS: set the initial window position after window is loaded 2026-03-11 17:45:09 +01:00
Lukas
e8c82ca1af macOS: save frame only if the window is visible 2026-03-11 17:45:09 +01:00
Lukas
0af9938ad2 macos: add UI test for window position restore across titlebar styles
Tests that window position and size are correctly restored after
reopen for all four macos-titlebar-style variants.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 17:45:09 +01:00
Mitchell Hashimoto
86c2a2e87f input: add direct set_surface_title and set_tab_title actions
Fixes #11316

This mirrors the `prompt` actions (hence why there is no window action
here) and enables setting titles via keybind actions which importantly
lets this work via command palettes, App Intents, AppleScript, etc.
2026-03-11 09:25:08 -07:00
ydah
c2206542d3 macos: fix tab title rename hit testing and focus handling in fullscreen mode 2026-03-11 07:24:49 -07:00
Mitchell Hashimoto
6dd5b856b0 macos: disable Tahoe one-time codes
This disables all the automatic one-time code inputs in Ghostty.
It'd be really neat to actually dynamically change this (not sure if its
possible with NSTextContext or how often thats cached) but for now we
should just fully disable it.
2026-03-10 19:41:22 -07:00
Lukas
90dc4315e2 macos: add test cases for Ghostty.Config properties
Test boolean, string, enum, and numeric config properties using
TemporaryConfig to verify defaults and parsed values.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-10 20:03:17 +01:00
Lukas
32934445cf macos: add TemporaryConfig for AI to write test cases 2026-03-10 19:45:52 +01:00
Mitchell Hashimoto
71f81527ad macos: remove IntrinsicSizeTimingTests temporarily
These were too flaky.
2026-03-10 11:08:47 -07:00
Mitchell Hashimoto
f88b42ad39 macos: add enum type for macos-titlebar-style (#11262) 2026-03-10 10:58:47 -07:00
Mitchell Hashimoto
c06ede5849 macos: make paste_from_clipboard performable on macos (#11328)
Fixes #10751
2026-03-10 10:31:22 -07:00
Mitchell Hashimoto
aaad43c235 macos: make paste_from_clipboard performable on macos
Fixes #10751
2026-03-10 10:25:14 -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
Lukas
de0f2ab22d macos: add enum type for macos-titlebar-style 2026-03-10 17:15:14 +01:00
Mitchell Hashimoto
3782d118e1 macOS: restore keyboard focus after inline tab title edit (#11320)
## Summary

- After finishing an inline tab title edit (via keybind or
double-click), all keyboard input is lost because
`TabTitleEditor.finishEditing()` sets `makeFirstResponder(nil)`, leaving
the window itself as first responder with no path back to the terminal
surface.
- Adds a `tabTitleEditorDidFinishEditing` delegate callback to
`TabTitleEditorDelegate` that fires after every edit (commit or cancel).
- `TerminalWindow` implements it by calling
`makeFirstResponder(focusedSurface)` to restore keyboard focus to the
terminal.

Fixes https://github.com/ghostty-org/ghostty/discussions/11315

## Testing

- [x] Bind `prompt_tab_title` to a keybind (e.g. `keybind =
cmd+shift+i=prompt_tab_title`)
- [x] Trigger inline tab title edit via keybind, press Enter — verify
keyboard input works immediately
- [x] Trigger inline tab title edit via keybind, press Escape — verify
keyboard input works immediately
- [x] Double-click a tab title, press Enter — verify keyboard input
works immediately
- [x] Double-click a tab title, press Escape — verify keyboard input
works immediately
- [x] Verify Cmd+number tab switching works after all of the above
- [x] Verify split pane focus is correct after editing tab title with
splits open

AI disclosure: Codebase exploration and review via [Claude
Code](https://claude.com/claude-code)
2026-03-10 08:59:51 -07:00
chronologos
7629130fb4 macOS: restore keyboard focus after inline tab title edit
After finishing an inline tab title edit (via keybind or double-click),
`TabTitleEditor.finishEditing()` calls `makeFirstResponder(nil)` to
clear focus from the text field, leaving the window itself as first
responder. No code path restores focus to the terminal surface, so all
keyboard input is lost until the user clicks into a pane.

Add a `tabTitleEditorDidFinishEditing` delegate callback that fires
after every edit (commit or cancel). TerminalWindow implements it by
calling `makeFirstResponder(focusedSurface)` to hand focus back to the
terminal.

Fixes https://github.com/ghostty-org/ghostty/discussions/11315

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-10 08:52:00 -07:00
Lukas
a6cd1b08af macOS: fix intrinsicContentSize race in windowDidLoad (#11256)
Add initialContentSize fallback on TerminalViewContainer so
intrinsicContentSize returns the correct value immediately,
without waiting for @FocusedValue to propagate. This removes
the need for the DispatchQueue.main.asyncAfter 40ms delay.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 15:35:49 +01:00
Lukas
cfedda1a0e macOS: add regression tests for intrinsicContentSize race (#11256)
Tests that validate intrinsicContentSize returns a correct value when
TerminalController.windowDidLoad() reads it. Currently fail, proving
the race condition where @FocusedValue hasn't propagated
lastFocusedSurface before the 40ms timer fires.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 15:27:38 +01:00
Mitchell Hashimoto
a6ee1fb292 macos: increase window-width/height apply delay from 10ms to 40ms
Band-aid for #10304

We don't have a robust fix yet but this should help mitigate more
scenarios.
2026-03-09 08:42:07 -07:00
Mitchell Hashimoto
dd3d72c3de Revert "macOS: filter proper intrinsicContentSize when opening new window (#11257)"
This reverts commit 3445c9afda, reversing
changes made to 1e981f858a.
2026-03-09 08:33:24 -07:00