diff --git a/macos/Sources/Features/Terminal/TerminalController.swift b/macos/Sources/Features/Terminal/TerminalController.swift index 81c74987b..698551f3e 100644 --- a/macos/Sources/Features/Terminal/TerminalController.swift +++ b/macos/Sources/Features/Terminal/TerminalController.swift @@ -94,6 +94,16 @@ class TerminalController: BaseTerminalController { } } + + override func fullscreenDidChange() { + super.fullscreenDidChange() + + // When our fullscreen state changes, we resync our appearance because some + // properties change when fullscreen or not. + guard let focusedSurface else { return } + syncAppearance(focusedSurface.derivedConfig) + } + //MARK: - Methods @objc private func ghosttyConfigDidChange(_ notification: Notification) { @@ -204,7 +214,13 @@ class TerminalController: BaseTerminalController { } // If we have window transparency then set it transparent. Otherwise set it opaque. - if (surfaceConfig.backgroundOpacity < 1) { + + // Window transparency only takes effect if our window is not native fullscreen. + // In native fullscreen we disable transparency/opacity because the background + // becomes gray and widgets show through. + if (!window.styleMask.contains(.fullScreen) && + surfaceConfig.backgroundOpacity < 1 + ) { window.isOpaque = false // This is weird, but we don't use ".clear" because this creates a look that diff --git a/src/config/Config.zig b/src/config/Config.zig index 2dc732752..97ac19226 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -527,6 +527,10 @@ palette: Palette = .{}, /// The opacity level (opposite of transparency) of the background. A value of /// 1 is fully opaque and a value of 0 is fully transparent. A value less than 0 /// or greater than 1 will be clamped to the nearest valid value. +/// +/// On macOS, background opacity is disabled when the terminal enters native +/// fullscreen. This is because the background becomes gray and it can cause +/// widgets to show through which isn't generally desirable. @"background-opacity": f64 = 1.0, /// A positive value enables blurring of the background when background-opacity