Use foreground color in macOS tab titles #3843
Open
+91
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm not a Zig or a Swift/macOS developer but I've been really liking GhostTTY and wanted to open this PR to either contribute back, or at least share the progress/learnings when tackling #2764 (which I think this should close, if this is a valid approach). I have a vimscript that syncs the terminal colors with my vim theme, so I was pretty motivated to implement this feature.
This change was relatively straightforward (but required a lot of learning). In general it:
foregroundColor
in the SurfaceView. It's pre-populated with the config defined foreground color. It is also updated via the color change events (which I added foreground support to)titleForegroundColor
property to use inTerminalWindow
titles so the colors can be updated dynamically.syncAppearance
is called. (I'm honestly not sure if this is the best approach, but it's the solution I found. happy to update if there's a better approach)syncAppearance
when a window becomes the key window to sync the colors across each tab.systemFontSize
to match the existing behavior/size of tabs (happy to provide screenshots to elaborate)Here's a quick screencap of the new behavior:
Kapture.2024-12-28.at.21.49.46.mp4
I also quickly validated that this works with `macos-titlebar-style=transparent` in addition to `tabs`
and just for completions sake, bg transparency: