-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
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
VS Code test-output terminal does not render styles #74
Comments
Thanks for the detailed report. We can definitely use some better docs around this. The reason this happens is because Lip Gloss automatically degrades colors to the best available option in the given terminal. Because Go tests run in a sub-process, they're not attached to a TTY and thus Lip Gloss strips color output entirely. However! You can force a color profile in your tests with SetColorProfile. import (
"github.com/charmbracelet/lipgloss"
"github.com/muesli/termenv"
)
lipgloss.SetColorProfile(termenv.TrueColor) P.S. This project looks really cool and we absolutely love it when people make games with our stuff. Please do let us know when it's available (twitter, fediverse, email, slack). |
Hey 👋🏼 — I think I am in a similar situation like @mfridman. When I let lipgloss auto-detect the environment, then I have problems on GHA to use the tool in the steps. It stops and hangs — for as long as the workflow can run. I changed the output of my tool to return json, which bypasses lipgloss and bubbletea entirely, then the steps complete within seconds. So it seems like detection to check for a I am not sure if this detection needs to be in lipgloss or bubbletea (or both). I am currently trying this code to configure it: if fileInfo, _ := os.Stdout.Stat(); (fileInfo.Mode() & os.ModeCharDevice) != 0 {
// we can be extra fancy since this is a terminal
} else {
// probably a non-interactive session in runner, pipe or CI tool
lipgloss.SetColorProfile(termenv.Ascii)
} I guess at the very least, I hope |
Like any reasonable person with a three-year-old, I'm making a TUI Connect-4 clone for local network play (toddlers cannot physically prevent you from making a blocking move when they are in another room).
Testing my work-in-progress had me seriously confused:
Turns out that the terminal which displays the output from this inline test-running button (maybe the entire integrated test runner) doesn't display any colours. (You would certainly know better than me how to characterize the behaviour).
Note that this is not the case for VSCode's more general terminal:
Suggestions:
Nice library. Enjoying the renewed interest and vigor in modernizing cli / tui tooling. Good luck!
The text was updated successfully, but these errors were encountered: