macos: add proxy icon hover mode and disabled state
Implements #5919.
Extends macos-titlebar-proxy-icon to three values:
visible— always show the proxy icon (old default)hidden— show on hover via NSTrackingArea on the titlebar (new default)disabled— never show, also disables drag-drop and cmd-click path menu
The hover tracking uses NSTrackingArea with .mouseEnteredAndExited on TerminalWindow.titlebarContainer. A cached currentPwdURL is kept separate from representedURL so switching from disabled back to visible/hidden restores the icon without waiting for the next cd.
Config changes apply immediately to open windows through GhosttyConfigDidChange.
Here's what the hover mode looks like:
AI Usage
Used Claude Opus via Claude Code (GSD workflow) for initial config scaffolding. Swift/AppKit hover implementation written by hand. Codex used for review pass. I understand all the code.
Always-visible is actually legacy macOS behavior from before Monterey. Since macOS 12 the system default has been hover-to-show — Finder, Xcode, etc. all do this now. Terminal.app still shows it permanently but that's more of a "hasn't been updated" thing than a deliberate choice.
The mapping from old to new: visible = same as before, always show. hidden = hover to show (what macOS does by default since Monterey). disabled = what hidden used to be, completely off.
Defaulting to hidden just matches what the OS does. But if you'd rather not change the default I can keep it at visible, no strong feelings.
Always-visible is actually legacy macOS behavior from before Monterey. Since macOS 12 the system default has been hover-to-show — Finder, Xcode, etc. all do this now. Terminal.app still shows it permanently but that's more of a "hasn't been updated" thing than a deliberate choice.
The mapping from old to new:
visible= same as before, always show.hidden= hover to show (what macOS does by default since Monterey).disabled= whathiddenused to be, completely off.Defaulting to
hiddenjust matches what the OS does. But if you'd rather not change the default I can keep it atvisible, no strong feelings.
This is true when there is a toolbar, as I commented in the discussion.
So I would suggest adding an empty toolbar to hidden (hover to show), and removing it otherwise. This would match the system's default behaviour, without the hassle of adding a tracking area ourselves, but titlebarTextField and titlebarContainer may need some tweaks as well, depending on whether there is a toolbar or not.
let toolbar = NSToolbar(identifier: "TerminalToolbar")
self.toolbar = toolbar
toolbarStyle = .unifiedCompact
@jcollie What do you think?
@jcollie What do you think?
I'm not really a macOS dev so I'll leave the review to others.