• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

muesli / termenv / 5694552778
58%
master: 50%

Build:
Build:
LAST BUILD BRANCH: dependabot/github_actions/actions/checkout-6
DEFAULT BRANCH: master
Ran 28 Jul 2023 05:16PM UTC
Jobs 1
Files 12
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Jul 2023 05:15PM UTC coverage: 58.36% (+0.5%) from 57.843%
5694552778

push

github

aymanbagabas
fix!: output race condition

`ColorProfile` reads the terminal environment every time the function is
called. This is inefficient. We only need to read the `$TERM`
environment variable once when we initialize the output. So instead, we cache
the value we read.

Rename `ColorProfile` to `termColorProfile` and rely on
`EnvColorProfile` to detect the profile. Ideally, we would rely on the
terminal Terminfo to detect the profile and fallback to the environment.
But that's for another day :)

Make output profile accessible through `ColorProfile`.
Use `SetColorProfile` to change the output color profile.
Use a mutex to guard output writes.
Use pointer receiver since we have a lock in the struct

Fixes: https://github.com/charmbracelet/lipgloss/pull/210
Fixes: https://github.com/muesli/termenv/issues/145

81 of 81 new or added lines in 6 files covered. (100.0%)

548 of 939 relevant lines covered (58.36%)

18.86 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
50.59
0.0% screen.go
2
92.68
0.0% templatehelper.go
3
73.47
-4.79% termenv.go
3
8.16
0.0% termenv_unix.go
4
80.0
2.68% output.go

Uncovered Existing Lines

Lines Coverage ∆ File
1
92.68
0.0% templatehelper.go
2
80.0
2.68% output.go
Jobs
ID Job ID Ran Files Coverage
1 5694552778.1 28 Jul 2023 05:16PM UTC 12
58.36
GitHub Action Run
Source Files on build 5694552778
  • Tree
  • List 12
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 3c898b2c on github
  • Prev Build on master (#5627559678)
  • Next Build on race-fix (#5695481766)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc