-
Notifications
You must be signed in to change notification settings - Fork 285
Open
Milestone
Description
Describe the bug
When a custom renderer is defined with the WithProfile method, it is not being respected, when TERM=xterm and COLORTERM is unset.
Setup
Please complete the following information along with version numbers, if applicable.
- OS Linux
- Shell bash
- Terminal Emulator PuTTy
To Reproduce
export TERM=xterm
unset COLORTERM
and run the below code:
package main
import (
"fmt"
"os"
"github.com/charmbracelet/lipgloss"
"github.com/muesli/termenv"
)
func main() {
renderer := lipgloss.NewRenderer(os.Stdout, termenv.WithProfile(termenv.TrueColor))
style := renderer.NewStyle().Foreground(lipgloss.Color("#FF0000")) // bright red
fmt.Fprint(os.Stdout, style.Render("Hello, World!"))
}
Source Code
We have to explicitly do:
package main
import (
"fmt"
"os"
"github.com/charmbracelet/lipgloss"
"github.com/muesli/termenv"
)
func main() {
renderer := lipgloss.NewRenderer(os.Stdout, termenv.WithProfile(termenv.TrueColor))
renderer.SetColorProfile = termenv.TrueColor
style := renderer.NewStyle().Foreground(lipgloss.Color("#FF0000")) // bright red
fmt.Fprint(os.Stdout, style.Render("Hello, World!"))
}
Expected behavior
It should render in color.
Metadata
Metadata
Assignees
Labels
No labels