From 168c10aed0aab1194779481561fd73b33580bfa2 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Thu, 21 Nov 2024 17:10:58 +0200 Subject: feat: add global background color --- internal/client/client.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'internal/client/client.go') diff --git a/internal/client/client.go b/internal/client/client.go index 073da82..938a265 100644 --- a/internal/client/client.go +++ b/internal/client/client.go @@ -5,6 +5,7 @@ import ( "reflect" tea "github.com/charmbracelet/bubbletea" + "github.com/muesli/termenv" "github.com/kyren223/eko/internal/client/config" "github.com/kyren223/eko/internal/client/ui" @@ -29,6 +30,12 @@ func Run() { log.Fatalf("Config file at '%v' was unable to load successfully\n%v\n", config.ConfigFile, err) } + // HACK: Sets the terminal color and keeps it that way + // I am not aware of a way to query the current background color (to revert this) + // Ideally bubbletea will handle the setting/reventing, for now it's fine + // It only changes the current pane so new terminal panes/windows are not affected. + termenv.DefaultOutput().SetBackgroundColor(termenv.RGBColor(ui.BackgroundColor)) + program := tea.NewProgram(initialModel(), tea.WithAltScreen()) assert.AddFlush(BubbleTeaCloser{program}) -- cgit v1.3.1