We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
TERM=xterm
COLORTERM
Setup Please complete the following information along with version numbers, if applicable.
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.
The text was updated successfully, but these errors were encountered:
In v2 this is what it would look like to set the color profile outside of a Bubble Tea app:
v2
func main() { // detect the environment's capabilities w := colorprofile.NewWriter(os.Stdout, os.Environ()) // Pretend we want to force truecolor. w.Profile = colorprofile.TrueColor style := lipgloss.NewStyle().Foreground(lipgloss.Color("#FF0000")) // bright red fmt.Fprint(w, style.Render("Hello, World!")) }
using colorprofile
Sorry, something went wrong.
No branches or pull requests
Describe the bug
When a custom renderer is defined with the WithProfile method, it is not being respected, when
TERM=xterm
andCOLORTERM
is unset.Setup
Please complete the following information along with version numbers, if applicable.
To Reproduce
export TERM=xterm
unset COLORTERM
and run the below code:
Source Code
We have to explicitly do:
Expected behavior
It should render in color.
The text was updated successfully, but these errors were encountered: