Commit Graph

81 Commits (bbbb52ed7534a580ad2b3a5ca9df282eaef1e820)

Author SHA1 Message Date
Mitchell Hashimoto bbbb52ed75
macos: goto_split direction is performable (#9284)
Fixes #9283

There was a comment here noting this deficiency. GTK implements this
properly.
2025-10-23 09:48:44 -07:00
Mitchell Hashimoto d8d232e5a2
macos: avoid any zero-sized content size increments (#9020)
Fixes #9016
2025-10-06 09:05:22 -07:00
Mitchell Hashimoto 3d0846051f
macos: bell-features=title works again
This was a regression we didn't fix before 1.2.
2025-09-29 12:53:42 -07:00
Mitchell Hashimoto 1041a4cc9b
macos: set initial window in TerminalWindow awakeFromNib
Maybe fixes #8736

I thought `windowDidLoad` was early on because its before the window is
shown but apparently not. Let's try `awakeFromNib` which is called
just after the window is loaded from the nib. It is hard to get any
earlier than that.
2025-09-29 12:52:49 -07:00
Moeeze Hassan f4009721a1 macOS: order out alert sheets to avoid Stage Manager focus loss
Signed-off-by: Moeeze Hassan <fammas.maz@gmail.com>
2025-08-22 09:05:20 -07:00
Mitchell Hashimoto f096675eaf
macos: Close Terminal Intent 2025-06-21 06:39:20 -07:00
Mitchell Hashimoto bbb69c8f27
macos: NewTerminalIntent returns Terminal, can split 2025-06-21 06:39:19 -07:00
Mitchell Hashimoto 658ec2eb6f
macos: add reset zoom to all window titles 2025-06-12 14:33:53 -07:00
Mitchell Hashimoto a804dab288
macos: native terminal style works with new subclasses 2025-06-11 15:18:02 -07:00
Mitchell Hashimoto 2b9a6a4820
macos: unsplit window shouldn't allow split zooming
This was always the case, and is a recent regression from the SplitTree
rework. This brings it back to the previous behavior.
2025-06-10 12:11:18 -07:00
Mitchell Hashimoto 20744f0482
macos: fix some CI build issues 2025-06-07 12:46:15 -07:00
Mitchell Hashimoto 973a2afdde
macos: make sure we're not registering unnecessary undos 2025-06-07 12:46:15 -07:00
Mitchell Hashimoto 33d128bcff
macos: remove TerminalManager
All logic related to TerminalController is now in TerminalController.
2025-06-07 12:46:15 -07:00
Mitchell Hashimoto 5507ec0fc0
macos: compile errors in CI 2025-06-07 12:46:15 -07:00
Mitchell Hashimoto 49cc88f0d3
macos: configurable undo timeout 2025-06-07 12:46:14 -07:00
Mitchell Hashimoto 104cc2adfe
macos: basic undo close window, not very robust yet 2025-06-07 12:46:14 -07:00
Mitchell Hashimoto 6d32b01c64
macos: implement a custom ExpiringUndoManager, setup undo for new/close 2025-06-07 12:46:14 -07:00
Mitchell Hashimoto 493b1f5350
wip: undo 2025-06-07 12:46:13 -07:00
Mitchell Hashimoto c40ac6b785
input: add focus split directional commands to command palette 2025-06-05 07:11:18 -07:00
Mitchell Hashimoto 69c3c359cb
macos: resize split keybind handling 2025-06-05 07:05:13 -07:00
Mitchell Hashimoto 5299f10e13
macos: unzoom on new split and focus change 2025-06-05 07:05:13 -07:00
Mitchell Hashimoto 19a9156ae1
macos: address remaining todos 2025-06-05 07:05:13 -07:00
Mitchell Hashimoto 6c97e4a59a
macos: fix focus after closing splits 2025-06-05 07:05:13 -07:00
Mitchell Hashimoto 77458ef308
macos: rename surfaceTree2 to surfaceTree 2025-06-05 07:05:13 -07:00
Mitchell Hashimoto f1ed07caf4
macos: Remove the legacy SurfaceTree 2025-06-05 07:05:13 -07:00
Mitchell Hashimoto 8b979d6dce
macos: handle surfaceTreeDidChange 2025-06-05 07:05:12 -07:00
Mitchell Hashimoto ea1ff438f8
macos: handle split zooming 2025-06-05 07:05:12 -07:00
Mitchell Hashimoto b7c01b5b4a
macos: spatial focus navigation 2025-06-05 07:05:12 -07:00
Mitchell Hashimoto ec7fd94d0f
macos: equalize splits works with new tree 2025-06-05 07:05:12 -07:00
Mitchell Hashimoto a389926ca7
macos: use surfaceTree2 needsConfirmQuit 2025-06-05 07:05:12 -07:00
Mitchell Hashimoto aef61661a0
macos: fix up command palette, focusing 2025-06-05 07:05:12 -07:00
Mitchell Hashimoto 0fb58298a7
macos: focus split previous/next 2025-06-05 07:05:11 -07:00
Mitchell Hashimoto b84b715ddb
macos: unify confirm close in our terminal controllers 2025-06-05 07:05:11 -07:00
Mitchell Hashimoto d1dce1e372
macos: restoration for new split tree 2025-06-05 07:05:11 -07:00
Mitchell Hashimoto 33d94521ea
macos: setup sequence for SplitTree 2025-06-05 07:05:11 -07:00
Mitchell Hashimoto 672d276276
macos: confirm close on split close 2025-06-05 07:05:11 -07:00
Mitchell Hashimoto e3bc3422dc
macos: handle split resizing 2025-06-05 07:05:11 -07:00
Mitchell Hashimoto 1707159441
new SplitTree 2025-06-05 07:05:11 -07:00
Mitchell Hashimoto d1f1be8833
macos: fix small memory leak in surface tree when closing splits
This fixes a small memory leak I found where the `SplitNode.Leaf` was
not being deinitialized properly when closing a split. It would get
deinitialized the next time a split was made or the window was closed,
so the leak wasn't big. The surface view underneath the split was also
properly deinitialized because we forced it, so again, the leak was
quite small.

But conceptually this is a big problem, because when we change the
surface tree we expect the deinit chain to propagate properly through
the whole thing, _including_ to the SurfaceView.

This fixes that by removing the `id(node)` call. I don't find this to be
necessary anymore. I don't know when that happened but we've changed
quite a lot in our split system since it was introduced. I'm also not
100% sure why the `id(node)` was causing a strong reference to begin
with... which bothers me a bit.

AI note: While I manually hunted this down, I started up Claude Code and
Codex in separate tabs to also hunt for the memory leak. They both
failed to find it and offered solutions that didn't work.
2025-06-02 14:12:26 -07:00
Mitchell Hashimoto fd7132db71
macos: quick terminal can equalize splits
Fixes #7480
2025-05-30 15:13:30 -07:00
Mitchell Hashimoto 2caa8a3fe1
macOS: move window title handling fully to AppKit
Fixes #7236
Supersedes #7249

This removes all of our `focusedValue`-based tracking of the surface
title and moves it completely to the window controller. The window
controller now sets up event listeners (via Combine) when the focused
surface changes and updates the window title accordingly.

There is some complicated logic here to handle when we lose focus to
something other than a surface. In this case, we want our title to be
the last focused surface so long as it exists.
2025-05-06 14:57:19 -07:00
Mitchell Hashimoto 732500b418
feat: implement toggleMaximize for macOS (#7191)
Resolve #7030
2025-05-06 13:43:57 -07:00
Mitchell Hashimoto e2a0f439c6
macOS: save/restore firstResponder on non-native fullscreen
Fixes #6999

It appears that at some point one of the operations causes focus to move
away for non-native fullscreen. We previously relied on the delegate
method to restore this but a better approach appears to handle this
directly in the fullscreen implementations. This fixes the linked issue.

I still think long term all the `Ghostty.moveFocus` stuff is a code
smell and we should be auditing all that code to see if we can
eliminate it. But this is a step in the right direction, and removes one
of those uses.
2025-05-06 12:59:31 -07:00
Aaron Ruan 13f776d483
Rename maximize notification and refine handler 2025-04-28 10:20:29 +08:00
Aaron Ruan 1ec3e331de
Refactor toggleMaximize to use notifications 2025-04-27 08:48:06 +08:00
Mitchell Hashimoto 63b4cb4ead
macOS: fix responder chain 2025-04-21 10:17:02 -07:00
Mitchell Hashimoto 6d2685b5a2
add toggle command palette binding 2025-04-21 10:05:30 -07:00
Mitchell Hashimoto 8bd91e7104
macOS: hook up full action execution 2025-04-21 09:40:08 -07:00
Mitchell Hashimoto 0915a7af46
macOS: extract TerminalCommandPalette 2025-04-21 09:18:46 -07:00
Mitchell Hashimoto 8d395c094b
macos: set title of terminal window immediately if configured
Fixes #5934 for macOS

If a `title` config is set, this change sets the title immediately on
windowDidLoad to ensure that the window appears with the correct title
right away.

If there is any reason to set another title, the `set_title` apprt
action will come on another event loop tick (due to our usage of
notifications) but that's okay since that's already how it works. This
is just to say that setting this here won't break any shell integration
or anything.
2025-03-02 13:27:40 -08:00