Commit Graph

1504 Commits

Author SHA1 Message Date
Mitchell Hashimoto
338c9b15aa splits: make resize_split and toggle_split_zoom non-performable with single pane (#10376)
Refer to discussion #10000 

When a tab contains only a single split, resize_split and
toggle_split_zoom actions now return false (not performed). This allows
keybindings marked with `performable: true` to pass the event through to
the terminal program.

The performable flag causes unperformed actions to be treated as if the
binding didn't exist, so the key event is sent to the terminal instead
of being consumed.

- Add isSplit() helper to SplitTree to detect single-pane vs split state
- Update GTK resizeSplit/toggleSplitZoom to return false when single
pane
- Update macOS resizeSplit/toggleSplitZoom to return Bool and check
isSplit
- Add unit test for isSplit method
2026-01-22 08:23:57 -08:00
MrConnorKenway
02d6dc0672 feat(macos): focus surface view if search box is manually closed 2026-01-22 09:25:47 +08:00
Mitchell Hashimoto
6730afe312 macOS: Add GhosttyUITests (Drafting to save some ci checks) (#9185)
### Background

~~I was trying to add a few UI test cases for
`macOS-titlebar-style`[Already in this PR]~~. In order to do this, I
need a way from `GhosttyKit` to load a temporary configuration without
messing around with users'.

### Changes

- Add `ghostty_config_load_file` using the existing
[`loadFile`](dafb9e89a3/src/config/Config.zig (L3399))
- Use `xcbeautify` to format test&build errors
**Couldn't find a way to do this in `GhosttyXcodebuild`, if you have a
better approach please let me know!**
- Add GhosttyUITests target and test cases for
`GhosttyTitlebarTabsUITests`(#2349) and `GhosttyThemeTests`(#9360)

### NOTE

Running UI tests on the runner could be **very** slow and I couldn't
find a way to guarantee success, so I made these only runnable by
manually testing in Xcode.

Better to squash this🤪

> > Some of the test cases could fail when testing all the cases
together; a rerun would succeed.
2026-01-20 09:30:39 -08:00
Lars
3fda31a66a skip checking config file 2026-01-20 09:15:14 -08:00
Lars
bfe5a4be8f move config loading to Config 2026-01-20 09:15:14 -08:00
Lukas
32562e0c98 Update macos/Sources/Ghostty/Ghostty.App.swift
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-20 09:15:14 -08:00
Lars
a94a6e4b36 build: fix Ghostty-iOS compiling 2026-01-20 09:15:14 -08:00
Lars
4f667520fa macOS: GhosttyUITests 2026-01-20 09:15:14 -08:00
Mitchell Hashimoto
2db80e278e feat(macos): if the search box is empty directly close the box (#10384)
referring to the discussion:
https://github.com/ghostty-org/ghostty/discussions/9814

This is a very small change addressing the behavior for closing the
search bar. This removes an extra step when closing the search bar if
the query is empty
2026-01-20 08:33:43 -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
Steven Lu
6db4e437ca splits: make resize_split and toggle_split_zoom non-performable with single pane
When a tab contains only a single split, resize_split and toggle_split_zoom
actions now return false (not performed). This allows keybindings marked with
`performable: true` to pass the event through to the terminal program.

The performable flag causes unperformed actions to be treated as if the
binding didn't exist, so the key event is sent to the terminal instead of
being consumed.

- Add isSplit() helper to SplitTree to detect single-pane vs split state
- Update GTK resizeSplit/toggleSplitZoom to return false when single pane
- Update macOS resizeSplit/toggleSplitZoom to return Bool and check isSplit
- Add unit test for isSplit method
2026-01-19 17:34:34 +07:00
Nishant Joshi
c8f56ddaf8 feat(macos): if the search box is empty directly close the box 2026-01-18 10:08:51 -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
f34c69147a macos: use the new binding flags information value to trigger menu 2026-01-09 07:13:14 -08:00
Mitchell Hashimoto
5a7fdf735e macos: custom tab title shows bell if active
Fixes #10210
2026-01-07 13:32:58 -08:00
Mitchell Hashimoto
323d362bc1 macos: dragging last window out of quick terminal works 2026-01-07 09:33:37 -08:00
Lukas
a265462aa6 macOS: moving a focused split to another tab should also update the previous tab 2026-01-07 09:18:41 -08:00
Lukas
02fc0f502f macOS: rename function to avoid mutating misunderstanding 2026-01-07 09:18:17 -08:00
Leah Amelia Chen
c559a1dbba Allow for default or inherited CWD in new window, tab and split surfaces (redone for GTK-NG) (#9158) 2026-01-07 20:45:06 +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
05a41c7772 macos: clean up menu 2026-01-06 14:20:34 -08:00
Mitchell Hashimoto
f07d600e43 macos: start_search with needle changes needle 2026-01-06 14:14:22 -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
Peter Guy
b119bc6089 consolidated enums 2026-01-05 16:47:04 -08:00
Peter Guy
d660799723 Consolidate the several ghostty_surface_inherited_config
functions back into a single function with a second parameter for the source context.
2026-01-05 16:47:04 -08:00
Peter Guy
c035fb5385 Add an enum type for the C API 2026-01-05 16:47:04 -08:00
Peter Guy
496f5b3ed7 Add the context to the Swift layer.
- Define NewSurfaceContext to match the Zig enum name and avoid magic numbers.
2026-01-05 16:47:04 -08:00
Peter Guy
dba0ff5339 Add C API function to handle new surfaces of different types 2026-01-05 16:47:04 -08:00
Martin Emde
c384cd050e Fix Mac window becomes unmovable after pane rearrangement
After rearranging panes, the window becomes permanently unmovable.
Grab handles temporarily set `window.isMovable = false` on hover to prevent
window dragging from interfering with pane dragging.

Override `viewWillMove(toWindow:)` to catch when the view is being removed from
the window. This lifecycle method is called before the window reference
becomes nil, allowing us to restore `window.isMovable`.
2026-01-01 15:56:25 -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
Mitchell Hashimoto
b3fbf11b0c macOS: temporarily disable window.isMovable to fix #10110 (#10125)
Fixes #10110
2026-01-01 12:45:08 -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
Lukas
1249f3b88c macOS: temporarily disable window.isMovable to fix #10110 2026-01-01 14:37:08 +01:00
Lukas
74fc48682a macOS: remove unused file 2026-01-01 14:31:11 +01:00
Mitchell Hashimoto
18abcaa797 macos: remove tab hover event, seems native handles it 2025-12-31 06:15:04 -08:00
Mitchell Hashimoto
d4ba0fa27e macos: last surface should close tab immediately not window 2025-12-30 15:07:28 -08:00
Mitchell Hashimoto
3e399a3d35 macos: detect surface tab bar hovers and focus them 2025-12-30 15:07:27 -08:00
Mitchell Hashimoto
f32d54bedb macos: make surface grab handle visible in light mode (#10111) 2025-12-30 13:14:49 -08:00
Mitchell Hashimoto
c34bb5976a macos: Ghostty.Command must copy string values
We were previously storing the C struct which contained pointers into
ephemeral memory that could cause segfaults later on.
2025-12-30 13:09:20 -08:00
Mitchell Hashimoto
43c7277a60 macos: make surface grab handle visible in light mode 2025-12-30 13:06:55 -08:00
John Xu
53c510ac40 macos: keep glass titlebar inset in sync on layout 2025-12-30 16:32:12 +08:00
Mitchell Hashimoto
a826892ef7 macos: make undo/redo work for final split dragged out
Fixes #10093
2025-12-29 11:15:19 -08:00
Mitchell Hashimoto
7512f6158b macos: fix bugs 2025-12-29 10:47:00 -08:00
Mitchell Hashimoto
19f7b57cd1 macos: fixup focus issues when closing the new window 2025-12-29 10:36:24 -08:00
Mitchell Hashimoto
29edbbbc86 macos: open dragged windows where they are dropped 2025-12-29 10:21:21 -08:00
Mitchell Hashimoto
5ecd26727e macos: allow pulling split out into its own window 2025-12-29 10:11:59 -08:00
Mitchell Hashimoto
89c515cab5 macos: new window from tree in TerminalController 2025-12-29 10:03:36 -08:00
Mitchell Hashimoto
25c413005b macos: emit a notification when the surface drag ends outside area 2025-12-29 09:55:18 -08:00
Mitchell Hashimoto
c164e3bc02 macos: fix messy rebase 2025-12-29 07:13:25 -08:00