summaryrefslogtreecommitdiff
path: root/internal/client/client.go
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2024-11-21 17:10:58 +0200
committerKyren223 <Kyren223@proton.me>2024-11-21 17:10:58 +0200
commit168c10aed0aab1194779481561fd73b33580bfa2 (patch)
tree72eb85c1b262a1670d1ece5aa3b45748a2cc2cc2 /internal/client/client.go
parent110794070bb19a590963aed020588494d741d668 (diff)
feat: add global background color
Diffstat (limited to 'internal/client/client.go')
-rw-r--r--internal/client/client.go7
1 files changed, 7 insertions, 0 deletions
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})