Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macos-icon-screen-color and macos-icon-ghost-color do not work in themes #3215

Open
nickkadutskyi opened this issue Dec 27, 2024 · 12 comments
Open
Labels
gui GUI or app issue regardless of platform (i.e. Swift, GTK) needs-confirmation A reproduction has been reported, but the bug hasn't been confirmed or reproduced by a maintainer. os/macos

Comments

@nickkadutskyi
Copy link

I have dark and light themes that provide macos-icon-ghost-color and macos-icon-screen-color but they do not change icon style on first load or when changing system theme.

Icon always appears like this which is a completely wrong color:
Image

dark theme

macos-icon = custom-style
macos-icon-ghost-color = BCBEC4
macos-icon-screen-color = 1E1F22

and light theme

macos-icon = custom-style
macos-icon-ghost-color = 000000
macos-icon-screen-color = FFFFFF

I've tried to set color to red and green and still it won't apply.
It only applies when I put macos-icon-screen-color and macos-icon-ghost-color into config file while macos-icon = custom-style works when provided by theme file.

@qwerasd205
Copy link
Collaborator

Duplicate of #3076

@nickkadutskyi
Copy link
Author

nickkadutskyi commented Dec 27, 2024

@qwerasd205 I've seen that but it's about the wrong color.
My issue is that the color won't work at all if I provide it via theme. E.g. setting this in theme file doesn't work while in config file sets screen color to green as expected:

macos-icon-ghost-color = BCBEC4
macos-icon-screen-color = 00FF00

@mitchellh
Copy link
Contributor

Going to reopen to investigate. It should work!

@qwerasd205
Copy link
Collaborator

The icon will only ever be generated on startup. Works as expected for me. I just tested putting this at the bottom of my theme config:

macos-icon = custom-style
macos-icon-ghost-color = #BCBEC4
macos-icon-screen-color = #00FF00

then saving and restarting Ghostty (completely) and it worked just fine. The green is much darker than would possibly be desirable, but that's that same issue.

@qwerasd205
Copy link
Collaborator

qwerasd205 commented Dec 27, 2024

The appearance of the icon in your screenshot is what you get for your light configuration (due to #3076). Changing the system theme will not do anything because the colorized icon settings cannot be hot reloaded right now. I do think we really had ought to support hot reloading of the colorized icon stuff since changing with the system theme would be fun, but as far as I can tell there is absolutely no problem loading these from config files specified by theme.

@nickkadutskyi
Copy link
Author

I did another test:

  1. Set system theme to light mode
  2. Set in light theme file this:
macos-icon-ghost-color = #BCBEC4
macos-icon-screen-color = #00FF00
  1. Set in config file this:
macos-icon = custom-style
  1. Remove anything related to macos-icon in dark theme file
  2. Restart Ghostty
  3. I get green screen color.
  4. Set system theme to dark mode
  5. Restart Ghostty
  6. I get green screen color

It seems like when I start Ghostty it always applies light theme first thus setting the icon and after that it applies dark theme (after checking actual system theme?) but at this point it doesn't change icon colors.

Here is another test where toggling a system theme while keeping Ghostty running changes the icon:

  1. Set system theme to light mode
  2. Set in light theme file this:
macos-icon = custom-style
macos-icon-ghost-color = #BCBEC4
macos-icon-screen-color = #00FF00
  1. Remove anything related to macos-icon in config file
  2. Set in dark theme file this:
macos-icon = official
  1. Restart Ghostty
  2. I get green screen color
  3. Toggle system theme
  4. Icon color changed to how official icon look like
  5. Toggle system theme again
  6. Icon color stays on the official icon

@qwerasd205
Copy link
Collaborator

Yes, it will go from colorized -> official when hot reloaded but not the other way around. If Ghostty is applying light mode first that is a problem though.

@qwerasd205
Copy link
Collaborator

In that case the real problem of this issue is that the light theme config is applied when it shouldn't be, which could theoretically be a problem with other things too- anything that is queried once after launch and then never again.

@mitchellh
Copy link
Contributor

If Ghostty is applying light mode first that is a problem though.

This shouldn't be a problem, just slightly wasteful (and you may see a shimmer I suppose of the wrong theme). We load the config on app init but we don't have an API to tell Ghostty what the system theme is until after initialized. This shouldn't be a root cause for this bug and I think we chalk this up to being unrelated.

@mitchellh mitchellh added os/macos needs-confirmation A reproduction has been reported, but the bug hasn't been confirmed or reproduced by a maintainer. gui GUI or app issue regardless of platform (i.e. Swift, GTK) labels Dec 27, 2024
@flaviuvlaicu
Copy link

Is it possible to change the color scheme of the icon even when the terminal is closed? Have a different scheme for when open and closed?

@appleton
Copy link

appleton commented Jan 6, 2025

I'm getting some weird behaviour where I seem to be able to set the background to certain colours (e.g. the green suggested above) but when I pick #F6F8FA I get a black background instead.

E.g. this config:

macos-icon = custom-style
macos-icon-frame = aluminum
macos-icon-ghost-color = #BCBEC4
macos-icon-screen-color = #00FF00

Yields this icon:

Image

But this config:

macos-icon = custom-style
macos-icon-frame = aluminum
macos-icon-ghost-color = #9F5EBC
macos-icon-screen-color = #F7F8FA

Yields this icon:

Image

I would expect the background to be basically white in the second example.

@qwerasd205
Copy link
Collaborator

@appleton that's unrelated to this issue and is already covered by #3076

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gui GUI or app issue regardless of platform (i.e. Swift, GTK) needs-confirmation A reproduction has been reported, but the bug hasn't been confirmed or reproduced by a maintainer. os/macos
Projects
None yet
Development

No branches or pull requests

5 participants