From 582cca37d645cf8a86dde8be1ea542087adc0ed7 Mon Sep 17 00:00:00 2001 From: Erich Fussi Date: Fri, 7 Mar 2025 17:42:22 +0100 Subject: [PATCH] fix: Don't log error for not finding header when running in headless mode (#3112) --- internal/ui/app.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/ui/app.go b/internal/ui/app.go index 16f9ebcf..acefef97 100644 --- a/internal/ui/app.go +++ b/internal/ui/app.go @@ -123,10 +123,12 @@ func (a *App) StylesChanged(s *config.Styles) { a.Main.SetBackgroundColor(s.BgColor()) if f, ok := a.Main.GetPrimitive("main").(*tview.Flex); ok { f.SetBackgroundColor(s.BgColor()) - if h, ok := f.ItemAt(0).(*tview.Flex); ok { - h.SetBackgroundColor(s.BgColor()) - } else { - log.Error().Msgf("Header not found") + if !a.Config.K9s.IsHeadless() { + if h, ok := f.ItemAt(0).(*tview.Flex); ok { + h.SetBackgroundColor(s.BgColor()) + } else { + log.Error().Msgf("Header not found") + } } } else { log.Error().Msgf("Main not found")