diff --git a/bubbletea/tea_unix.go b/bubbletea/tea_unix.go index 114150c7..7682b64c 100644 --- a/bubbletea/tea_unix.go +++ b/bubbletea/tea_unix.go @@ -12,6 +12,7 @@ import ( "github.com/charmbracelet/ssh" "github.com/charmbracelet/x/ansi" "github.com/charmbracelet/x/input" + "github.com/charmbracelet/x/term" "github.com/lucasb-eyer/go-colorful" "github.com/muesli/termenv" ) @@ -45,7 +46,11 @@ func newRenderer(s ssh.Session) *lipgloss.Renderer { termenv.WithEnvironment(env), termenv.WithColorCache(true), ) - bg, _ = queryBackgroundColor(pty.Slave, pty.Slave) + state, err := term.MakeRaw(pty.Slave.Fd()) + if err == nil { + bg, _ = queryBackgroundColor(pty.Slave, pty.Slave) + term.Restore(pty.Slave.Fd(), state) + } } else { r = lipgloss.NewRenderer( s, diff --git a/go.mod b/go.mod index ee361418..fa47eb36 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,7 @@ require ( github.com/charmbracelet/ssh v0.0.0-20240725163421-eb71b85b27aa github.com/charmbracelet/x/ansi v0.4.0 github.com/charmbracelet/x/input v0.2.0 + github.com/charmbracelet/x/term v0.2.0 github.com/go-git/go-git/v5 v5.12.0 github.com/google/go-cmp v0.6.0 github.com/hashicorp/golang-lru/v2 v2.0.7 @@ -29,7 +30,6 @@ require ( github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/charmbracelet/x/conpty v0.1.0 // indirect github.com/charmbracelet/x/errors v0.0.0-20240508181413-e8d8b6e2de86 // indirect - github.com/charmbracelet/x/term v0.2.0 // indirect github.com/charmbracelet/x/termios v0.1.0 // indirect github.com/cloudflare/circl v1.3.7 // indirect github.com/creack/pty v1.1.21 // indirect