Terminal background: decide 24-bit color like tcell, and log why

The check only looked at COLORTERM, but tcell also draws 24-bit color for
terminals whose description has it (xterm-ghostty, xterm-kitty), so in
Ghostty on macOS without COLORTERM the background was never used. Use
tcell's rules, and always log which background is used and why.

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:53:47 +02:00
co-authored by Claude Opus 5.5
parent 0270462fe4
commit d2e868293f
5 changed files with 48 additions and 18 deletions
+2 -4
View File
@@ -102,7 +102,7 @@ type overlay struct {
func New(cfg *config.Config) *App {
// Ask the terminal before the screen takes it over and before any widget
// copies the default background.
ownBackground := useTerminalBackground(terminalAnswers(), os.Getenv)
backgroundNote := useTerminalBackground(terminalAnswers(), os.Getenv)
a := &App{
app: tview.NewApplication(),
tabs: tview.NewTextView().SetDynamicColors(true),
@@ -139,9 +139,7 @@ func New(cfg *config.Config) *App {
if a.covers {
a.logs.add(levelInfo, coverNote)
}
if ownBackground {
a.logs.add(levelInfo, "Background: the terminal's own color")
}
a.logs.add(levelInfo, backgroundNote)
sabClient := sabnzbd.NewClient(cfg.SABnzbd.URL, cfg.SABnzbd.APIKey)
a.sab = sabClient
a.probes = []probe{