Closed embano1 closed 1 year ago
@embano1 To debug, can you try setting the env variable CI=true
?
Ah, that fixes it! So what's the issue here?
In a previous release tparse
was always setting:
lipgloss.SetColorProfile(termenv.TrueColor)
But then I changed it to only set that when CI=true
, which set in most envionments.
I suppose we could always set this, but it feels a bit awkward.
Reason I was asking is that I was used to running my tests locally and piping to tparse
. So just wondering why that stopped being coloured :)
I'm a bit stumped why colors don't display in your local terminal. I'll remove the conditional "CI" check, and add this line:
lipgloss.SetColorProfile(termenv.TrueColor)
But tbh I don't understand why this is needed. Maybe @caarlos0 knows?
I have native Terminal and VS Code, and both render colors.
Based on a cursory scan of muesli/termenv, there is a check for "CI" env flag that disables colors:
https://github.com/muesli/termenv/blob/55e6225a50df5a672ccb5a99b43bf2b0a70aba3e/termenv.go#L34-L40
I was observing this with GitHub Actions, noted here https://github.com/charmbracelet/lipgloss/issues/74#issuecomment-1133744453
So, adding the explicit lipgloss.SetColorProfile(termenv.TrueColor)
was necessary for CI environments.
For whatever reason, termenv
is not properly? detecting your env and setting the colors.
https://github.com/muesli/termenv/blob/55e6225a50df5a672ccb5a99b43bf2b0a70aba3e/termenv.go#L42-L50
Pushed a fix in v0.11.1
. This essentially reverts the explicit CI check, so colors should show up for you as before.
Awesome, works :)
maybe @embano1 has a CI
env set locally somehow? env | grep CI
shows anything?
afaik, termenv does a OSC query to check colors et al, and for that to work it needs to be an interactive term - since CI's aren't, it falls back. I might be wrong though, probably @muesli can explain better
Indeed, I introduced the CI
check as a workaround for some CI systems that pretend to be a proper terminal, but then never respond to any OSC queries, causing them to timeout. GitHub workflows always behaved fine in that regard, but CircleCI and others didn't.
maybe @embano1 has a
CI
env set locally somehow?env | grep CI
shows anything?
was my first guess, nothing set. Using tmux with oh my zsh on latest osx.
Please see the following output for different versions when running
tparse
against this repo.v0.11.0
seems to have lost color? Is there a way to debug this?v0.11.0
v0.10.3