From 63b11ceb5e0122e9feb3dac45fea0cf563ed6beb Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 31 Oct 2024 09:29:09 -0700 Subject: [PATCH] macos: quick terminal set colorspace --- .../QuickTerminal/QuickTerminalController.swift | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/macos/Sources/Features/QuickTerminal/QuickTerminalController.swift b/macos/Sources/Features/QuickTerminal/QuickTerminalController.swift index c382a62a0..bdd427be0 100644 --- a/macos/Sources/Features/QuickTerminal/QuickTerminalController.swift +++ b/macos/Sources/Features/QuickTerminal/QuickTerminalController.swift @@ -310,6 +310,19 @@ class QuickTerminalController: BaseTerminalController { return } + // Terminals typically operate in sRGB color space and macOS defaults + // to "native" which is typically P3. There is a lot more resources + // covered in this GitHub issue: https://github.com/mitchellh/ghostty/pull/376 + // Ghostty defaults to sRGB but this can be overridden. + switch (ghostty.config.windowColorspace) { + case "display-p3": + window.colorSpace = .displayP3 + case "srgb": + fallthrough + default: + window.colorSpace = .sRGB + } + // If we have window transparency then set it transparent. Otherwise set it opaque. if (ghostty.config.backgroundOpacity < 1) { window.isOpaque = false