-
Notifications
You must be signed in to change notification settings - Fork 572
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Support dark and light themes and syncing theme to system setting, a la window decorations #809
Comments
Contour has written a VT extension to notify applications using escape sequences that a color scheme change occurred. Would be good to include this reporting as part of this feature |
I would like to keep these separate and focus this issue on the process of configuring Ghostty with theme-specific configurations. I agree with supporting this once it has settled a bit though. |
Sharing some prior thinking I've had on this. None of this is set in stone, its not a mandate. Just thoughts. From a design perspective, I think its important that Ghostty retains the property that the CLI arguments and configuration format is isomorphic. I've personally always enjoyed it when software has had that property, because its easy to move stuff around between files and scripts. For those unaware, every Ghostty configuration key is also a valid CLI flag, and the format is identical. The config lines just don't have the So, I'd like to retain that property. I think the suggestion OP has around An approach I was trying to consider was the ability to annotate any config key with a condition in which it is active. For example: The condition proposal also would let us introduce other conditions. For example, I share my identical Ghostty config between macOS and Linux, and I'd love to have some Linux-specific keybindings. It'd be nice to do The condition proposal could also easily extend into AND, OR conditions, although there is no need to introduce that complexity today. I'm merely pointing out the framework allows for it. 🚲🏠 (Bikeshed): We could also bake the condition into the key, i.e. |
Regarding themes, Wezterm ships 700+ iTerm2 themes, is this something Ghostty will do too (or can be inspired by) ? |
Again, I'd like to not make that a focus of this issue, but we could definitely ship those as part of the resources directory. There are already over 250 Ghostty themes available here: https://github.com/mbadolato/iTerm2-Color-Schemes (Ghostty being one of the formats available) |
Note with #942 we now have built-in themes set with |
i've been meaning to sit down and hash out some alternate syntax proposals for this, but have been busy. re your latest bikeshed method, i'm not sure we WOULD have to quote so aggressively, at least in all cases... i think most shell parsers would let us get away with something like |
Yep! Happy to hear more bikeshed ideas, I think I've enumerated my constraints/desires clearly above but feel free to ask any Qs. |
I've used external scripts with kitty to provide light/dark toggling. Kitty has a subcommand to set individual colors, or it can load them from a file (e.g. a theme file). The subcommand even has other options for targeting all windows, how new windows are handled, etc. For my purposes I've been happy with just sending the theme change to all terminals. Adding concepts for light and dark are nice, but maybe just on-the-fly loading of a theme file could go a long way towards enabling that.
|
I think I’d prefer that as well, I don’t know how easier/harder it would be to configure. My sole usecase for "quick theme switching" is actually runtime cursor color switching. When I switch my editor from light to dark theme, I’d like to have a quick command (shelling out is ok) to change the cursor color from dark to bright. (Bear with my slow typing in the small demo) Enregistrement.de.l.ecran.2024-05-14.a.12.02.36.mov |
I have this autocommand in my neovim config which switches the ghostty theme. I just have to then press
|
I think, given we have built-in themes, an MVP would be separate |
Unless I'm missing something, themes are built into the release, so |
Under the current system, they would not. However, the current system is a bad fit for theme switching anyway: see above, where an entirely separate config seems like a sensible solution. Ideally we would have |
Since #2089, users can provide custom themes. This doesn't fix this issue at all but I'm just noting this as response based on the previous comments. |
Brainstorming another idea for conditional configuration directives (see this comment): Zig's Ghostty could do something similar, which would allow it to work for both the command line and config file. Essentially, rather than annotating individual options, options are grouped based on a condition. Hypothetical example: Command line
Config file
And the conditions to
It's admittedly a little unusual, but it at least solves the constraint of keeping the config file and command line isomorphic 😅 |
What would be the guidelines for proposing such a PR? I'm willing to look into it given I also have the need but don't want to waste anyones (myself included) time going in the wrong direction |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Several other popular terminals support the ability to configure independent themes for dark and light mode, which will then be automatically selected according to the system's dark or light mode setting. Ghostty already supports syncing the light or dark value of the window decorations with the system setting, so I imagine we could leverage the same logic for themes.
For a little bikeshedding, since themes are just configurations, I think it would probably make sense to introduce
light-config-file
anddark-config-file
for arbitrary configuration files that are loaded and unloaded according to the system setting. This would allow adjusting other settings if desired, such as fonts or transparency.The text was updated successfully, but these errors were encountered: