Setting the current surface's theme #3457
-
I'm hoping to clarify a comment discussing themes and new windows: #2363 (reply in thread) My use case is to set the theme in the current session before I ssh to a staging or production server and then revert it when the connection is closed. Other terms support this workflow with escape codes or shell integration. Is this possible now? If not, is it a planned feature? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
This is a huge one for me. I have a script called |
Beta Was this translation helpful? Give feedback.
-
There is no way to programatically control ghostty right now, or have a theme in a specific situation besides it detecting system light mode and dark mode changes. Ghostty plans on having support to be programmatically controlled in the future refer to #2353 for more details on that (besides editing an reloading the config) |
Beta Was this translation helpful? Give feedback.
-
There's an escape sequence to set the theme (OSC 4, 5, 6, 10-19, 104, 105, 106, 110-119, and there's also Kitty's extension which Ghostty also supports. As an example: printf '\e]10;#FFFFFF\a'
printf '\e]11;#000000\a'
printf '\e]4;3=#5F5E2A;6=#227685\a' Which can also be sent in a single printf '\e]10;#FFFFFF\a\e]11;#000000\a\e]4;3=#5F5E2A;6=#227685\a' It is equivalent to the following configuration in the Ghostty config format is: foreground = #FFFFFF
background = #000000
palette = 3=#5F5E2A
palette = 6=#227685 Note: this post was edited to switch from using the Kitty extension to XTerm's smattering of OSC sequences; see the comments under this post for the reason. You can find the old example in the edit history. |
Beta Was this translation helpful? Give feedback.
There's an escape sequence to set the theme (OSC 4, 5, 6, 10-19, 104, 105, 106, 110-119, and there's also Kitty's extension which Ghostty also supports.
I recommend using Kitty's extension as it's easier to useedit: use the former), which you could probably use as a workaround in your shell configuration or something. But as Bruce said, this is a duplicate of #2353.As an example:
Which can also be sent in a single
printf
:It is equivalent to the following configuration in the Ghostty config format is: