macos: add proxy icon hover mode and disabled state#12166
macos: add proxy icon hover mode and disabled state#12166MoonMao42 wants to merge 1 commit intoghostty-org:mainfrom
Conversation
Extend macos-titlebar-proxy-icon from two values (visible/hidden) to three (visible/hidden/disabled). hidden now means show-on-hover using NSTrackingArea on the titlebar, matching standard macOS behavior. disabled completely removes the proxy icon. Default changes from visible to hidden. Config changes apply immediately to all open windows via GhosttyConfigDidChange notification. Closes ghostty-org#5919
| /// editor, etc. | ||
| @"macos-titlebar-proxy-icon": MacTitlebarProxyIcon = .visible, | ||
| /// open windows immediately. | ||
| @"macos-titlebar-proxy-icon": MacTitlebarProxyIcon = .hidden, |
There was a problem hiding this comment.
We should not change the default to avoid surprising people that are used to (and perhaps prefer) the current behavior.
|
|
||
| var macosTitlebarProxyIcon: MacOSTitlebarProxyIcon { | ||
| let defaultValue = MacOSTitlebarProxyIcon.visible | ||
| let defaultValue = MacOSTitlebarProxyIcon.hidden |
There was a problem hiding this comment.
We should not change the default to avoid surprising people that are used to (and perhaps prefer) the current behavior.
|
|
||
| init() { | ||
| self.macosTitlebarProxyIcon = .visible | ||
| self.macosTitlebarProxyIcon = .hidden |
There was a problem hiding this comment.
We should not change the default to avoid surprising people that are used to (and perhaps prefer) the current behavior.
|
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: Defaulting to |
This is true when there is a toolbar, as I commented in the discussion. let toolbar = NSToolbar(identifier: "TerminalToolbar")
self.toolbar = toolbar
toolbarStyle = .unifiedCompact |
Implements #5919.
Extends
macos-titlebar-proxy-iconto 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 menuThe hover tracking uses
NSTrackingAreawith.mouseEnteredAndExitedonTerminalWindow.titlebarContainer. A cachedcurrentPwdURLis kept separate fromrepresentedURLso switching fromdisabledback tovisible/hiddenrestores the icon without waiting for the nextcd.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.