Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion bubbletea/tea.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package bubbletea

import (
"context"
"fmt"
"strings"

tea "github.com/charmbracelet/bubbletea"
Expand Down Expand Up @@ -115,9 +116,18 @@ func MakeRenderer(sess ssh.Session) *lipgloss.Renderer {
if !ok {
cp = termenv.Ascii
}

r := newRenderer(sess)

// We only force the color profile if the requested session is a PTY.
_, _, ok = sess.Pty()
if !ok {
return r
}

if r.ColorProfile() > cp {
wish.Printf(sess, "Warning: Client's terminal is %q, forcing %q\r\n", profileNames[r.ColorProfile()], profileNames[cp])
_, _ = fmt.Fprintf(sess.Stderr(), "Warning: Client's terminal is %q, forcing %q\r\n",
profileNames[r.ColorProfile()], profileNames[cp])
r.SetColorProfile(cp)
}
return r
Expand Down
Loading