From 2525382b27f7e5a0a38dce9493eced6551be8116 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Fri, 10 Nov 2023 07:55:09 -0600 Subject: [PATCH] terminal: initialize active palette with configured palette PR #850 introduced several color palette OSC setting and querying sequencing. In doing so, an active palette was introduced to enable resetting back to the default (configured) palette. The active palette was not initialized with the configured palette, thus any configured theme by the terminal was not set at launch. This behavior can be confirmed thanks to PR #852, which resets the active palette on configuration reload. To observe the behavior: 1. Set the configured palette to something other than the default 2. Open ghostty. Observe the color palette 3. Reload the configuration 4. Press enter for a new shell prompt. Note the palette has changed This patch sets the configured palette as the active palette at initialization. --- src/termio/Exec.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/termio/Exec.zig b/src/termio/Exec.zig index 50654b8fd..7a409e8f7 100644 --- a/src/termio/Exec.zig +++ b/src/termio/Exec.zig @@ -145,6 +145,7 @@ pub fn init(alloc: Allocator, opts: termio.Options) !Exec { ); errdefer term.deinit(alloc); term.default_palette = opts.config.palette; + term.color_palette.colors = opts.config.palette; // Set the image size limits try term.screen.kitty_images.setLimit(alloc, opts.config.image_storage_limit);