From 7fabfe4185ab1926f4f63e169f3edf9f5d6f4d0a Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Wed, 4 May 2022 22:11:02 +0200 Subject: [PATCH] Enforce true color profile --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 46cc518..bf3cc2f 100644 --- a/main.go +++ b/main.go @@ -12,6 +12,7 @@ import ( bm "github.com/charmbracelet/wish/bubbletea" lm "github.com/charmbracelet/wish/logging" "github.com/gliderlabs/ssh" + "github.com/muesli/termenv" "io/ioutil" "log" "math" @@ -47,7 +48,7 @@ func main() { wish.WithHostKeyPath(".ssh/term_info_ed25519"), wish.WithMiddleware( lm.Middleware(), - bm.Middleware(teaHandler), + bm.MiddlewareWithColorProfile(teaHandler, termenv.TrueColor), ), ) if err != nil { @@ -110,6 +111,7 @@ func teaHandler(s ssh.Session) (tea.Model, []tea.ProgramOption) { err: nil, dictionary: dictionary, textInput: ti, + username: s.User(), ip: s.RemoteAddr().String(), words: []word{}, progressBar: progress.New(progress.WithScaledGradient("#FF7CCB", "#FDFF8C")), @@ -130,6 +132,7 @@ type model struct { err error dictionary map[string]word textInput textinput.Model + username string ip string words []word wordsViewport viewport.Model