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

muesli / termenv
57%
master: 50%

Build:
Build:
LAST BUILD BRANCH: update-go-colorful
DEFAULT BRANCH: master
Repo Added 13 Jan 2020 04:16AM UTC
Files 14
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

LAST BUILD ON BRANCH color-cache
branch: color-cache
CHANGE BRANCH
x
Reset
  • color-cache
  • bump-deps
  • cach-default
  • cache-profile
  • check-nil
  • ci
  • ci-case
  • ci-osc
  • cloud-shell
  • colorfgbg-parsing
  • compat-readme
  • copy
  • copy-primary
  • coverage-workflow
  • default-color-cache
  • default-output
  • dependabot/github_actions/actions/checkout-4
  • dependabot/github_actions/actions/checkout-5
  • dependabot/github_actions/actions/setup-go-4
  • dependabot/github_actions/actions/setup-go-6
  • dependabot/github_actions/golangci/golangci-lint-action-3
  • dependabot/github_actions/golangci/golangci-lint-action-7
  • dependabot/github_actions/golangci/golangci-lint-action-8
  • dependabot/go_modules/examples/ssh/golang.org/x/crypto-0.35.0
  • dependabot/go_modules/github.com/aymanbagabas/go-osc52-1.2.1
  • dependabot/go_modules/github.com/aymanbagabas/go-osc52-1.2.2
  • dependabot/go_modules/github.com/mattn/go-isatty-0.0.16
  • dependabot/go_modules/github.com/mattn/go-isatty-0.0.17
  • dependabot/go_modules/github.com/mattn/go-isatty-0.0.18
  • dependabot/go_modules/github.com/mattn/go-isatty-0.0.19
  • dependabot/go_modules/github.com/mattn/go-isatty-0.0.20
  • dependabot/go_modules/github.com/mattn/go-runewidth-0.0.14
  • dependabot/go_modules/github.com/mattn/go-runewidth-0.0.15
  • dependabot/go_modules/golang.org/x/sys-0.10.0
  • dependabot/go_modules/golang.org/x/sys-0.11.0
  • dependabot/go_modules/golang.org/x/sys-0.12.0
  • dependabot/go_modules/golang.org/x/sys-0.13.0
  • dependabot/go_modules/golang.org/x/sys-0.5.0
  • dependabot/go_modules/golang.org/x/sys-0.6.0
  • dependabot/go_modules/golang.org/x/sys-0.7.0
  • dependabot/go_modules/golang.org/x/sys-0.8.0
  • dependabot/go_modules/golang.org/x/sys-0.9.0
  • deps
  • ext-mouse
  • fix-default-output
  • fix-deprecations
  • fix-disable-mouse-press
  • flush-check
  • getpgrp-solaris
  • ghostty
  • ioctl
  • kitty-ansi-detection
  • kkp
  • lint
  • linter-config
  • master
  • mux-note
  • names
  • osc52
  • osc777
  • race-fix
  • readme-badge
  • readme-clipboard
  • readme-env-vars
  • readme-links
  • readme-matrix
  • readme-order
  • readwriter
  • ref-color
  • refs/tags/v0.1
  • refs/tags/v0.1.0
  • refs/tags/v0.10.0
  • refs/tags/v0.11.0
  • refs/tags/v0.12.0
  • refs/tags/v0.13.0
  • refs/tags/v0.14.0
  • refs/tags/v0.15.0
  • refs/tags/v0.15.1
  • refs/tags/v0.15.2
  • refs/tags/v0.16.0
  • refs/tags/v0.2
  • refs/tags/v0.2.0
  • refs/tags/v0.3.0
  • refs/tags/v0.4.0
  • refs/tags/v0.5.0
  • refs/tags/v0.5.1
  • refs/tags/v0.5.2
  • refs/tags/v0.6.0
  • refs/tags/v0.7.0
  • refs/tags/v0.7.1
  • refs/tags/v0.7.2
  • refs/tags/v0.8.0
  • refs/tags/v0.8.1
  • refs/tags/v0.9.0
  • rename-notify
  • rxvt-term-suffix
  • screen-detection
  • seq-consts
  • sequence-timeout
  • session-cmds
  • shims-aix-plan9
  • ssh
  • ssh-pty
  • templatehelper-output
  • term-ctrl-grp
  • termenv-next
  • tests
  • tmux-statusreport
  • underline
  • uniseg-stringwidth
  • unsafe
  • update-docs
  • update-go-colorful
  • update-readme
  • update-ssh-example
  • vte-note
  • wezterm
  • windows-color-detection
  • windows-console

26 Aug 2023 12:52AM UTC coverage: 57.252% (-0.4%) from 57.655%
5981801130

Pull #149

github

aymanbagabas
fix: read fore/background colors on first access

Caching the colors in OutputOption makes the order of options important.
For example, if you're using WithUnsafe _after_ WithColorCache, the
colors wouldn't respect the `unsafe` option since the colors get cached
_during_ the execution of WithColorCache option.

Another example, is the use of a custom environ using the WithEnvironment
option. If WithEnvironment comes _after_ WithColorCache, reading the
terminal colors won't respect the values in the environment.

Instead, don't read the colors in WithColorCache and make the user
opt-in if they want to cache the colors right after creating a new
output using ForegroundColor and BackgroundColor.

```go
// To cache the colors after creating an output
output := NewOutput(os.Stderr)
_ = output.ForegroundColor()
_ = output.BackgroundColor()
```
Pull Request #149: fix: read fore/background colors on first access

525 of 917 relevant lines covered (57.25%)

8.82 hits per line

Relevant lines Covered
Build:
Build:
917 RELEVANT LINES 525 COVERED LINES
8.82 HITS PER LINE
Source Files on color-cache
  • List 12
  • Changed 2
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
5981801130 color-cache fix: read fore/background colors on first access Caching the colors in OutputOption makes the order of options important. For example, if you're using WithUnsafe _after_ WithColorCache, the colors wouldn't respect the `unsafe` option since the co... Pull #149 26 Aug 2023 12:53AM UTC aymanbagabas github
57.25
5981796586 color-cache fix: read fore/background colors on first access Caching the colors in OutputOption makes the order of options important. For example, if you're using WithUnsafe _after_ WithColorCache, the colors wouldn't respect the `unsafe` option since the co... push 26 Aug 2023 12:52AM UTC aymanbagabas github
57.08
5981796828 color-cache fix: read fore/background colors on first access Caching the colors in OutputOption makes the order of options important. For example, if you're using WithUnsafe _after_ WithColorCache, the colors wouldn't respect the `unsafe` option since the co... Pull #149 26 Aug 2023 12:52AM UTC aymanbagabas github
57.08
5981785709 color-cache fix: read fore/background colors on first access Caching the colors in OutputOption makes the order of options important. For example, if you're using WithUnsafe _after_ WithColorCache, the colors wouldn't respect the `unsafe` option since the co... Pull #149 26 Aug 2023 12:50AM UTC aymanbagabas github
57.08
See All Builds (630)
  • Repo on GitHub
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

© 2025 Coveralls, Inc