Use the terminal's own background color

The panes used palette color 0, which color themes such as Catppuccin set
to a grey lighter than their background: everything looked washed out and
grey text almost disappeared (seen in Ghostty on macOS). The startup probe
now also asks for the background color (OSC 11), and with 24-bit color and
a dark background that color is used. The probe always runs at startup, so
a later switch to real images in the Config view never has to ask the
terminal while the screen owns it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019reK4DUGYqDUjniWYJvwUW
This commit is contained in:
2026-10-21 11:47:27 +02:00
co-authored by Claude Opus 5.5
parent 7e77d56879
commit 0270462fe4
9 changed files with 192 additions and 35 deletions
+4 -12
View File
@@ -15,7 +15,6 @@ import (
"os/exec"
"runtime"
"strings"
"sync"
"time"
"github.com/gdamore/tcell/v2"
@@ -198,17 +197,10 @@ func resolveCovers(setting string, env func(string) string) (blocks coverStyle,
return coverStyleFor(setting, env), false
}
var (
kittyProbeOnce sync.Once
kittyProbeResult bool
)
// kittyGraphicsSupported asks the terminal once (see probeKittyGraphics) and
// remembers the answer. It is a variable so tests can replace it.
var kittyGraphicsSupported = func() bool {
kittyProbeOnce.Do(func() { kittyProbeResult = probeKittyGraphics(300 * time.Millisecond) })
return kittyProbeResult
}
// kittyGraphicsSupported reports whether the terminal confirmed the Kitty
// graphics protocol when it was asked at startup (see probeTerminal). It is a
// variable so tests can replace it.
var kittyGraphicsSupported = func() bool { return terminalAnswers().graphics }
// flatPixelError is the squared RGB distance per pixel below which a cell is
// drawn flat: smooth areas and noise should not turn into patterns.