supports-color known bugs
npm3 known bugs in supports-color, with affected versions, fixes and workarounds. Sourced from upstream issue trackers.
3
bugs
Known bugs
| Severity | Affected | Fixed in | Title | Status | Source |
|---|---|---|---|---|---|
| medium | any | \u2014 | Give TERM=dumb Higher Priority Emacs `M-x shell` runs the shell in an environment where the `TERM` variable is set to `dumb`, which informs the shell and applications that the terminal does not support any terminal control escape sequences.
While you have code to handle the [dumb](https://github.com/chalk/supports-color/blob/c94d6c51f60759f72a93d7c73c99e18dae995d73/index.js#L115) setting, both the Windows platform processing and the `TERM_PROGRAM` are processed first.
For instance on macOS,
```bash
$ cd /path/to/mocha/node_modules
$ TERM=dumb node -e "var tty = require('./supports-color'); console.log(tty.stdout);"
{ level: 2, hasBasic: true, has256: true, has16m: false }
$ TERM_PROGRAM= TERM=dumb node -e "var tty = require('./supports-color'); console.log(tty.stdout);"
false
```
Mocha is getting publicly blamed for [this](https://emacs.stackexchange.com/questions/27218/why-is-there-so-often-ugly-output-in-node-js-compilation-buffers). Suggestions?
| fixed | github:88 |
| medium | any | \u2014 | supportsColor() should recheck process.env.FORCE_COLOR At the moment, the `supportsColor()` function does not consider all the environment variables fresh each time it's called. This means changing `process.env.FORCE_COLOR` at runtime has no effect on the `supportsColor()` result.
This bug prevents us from being able to do `process.env.FORCE_COLOR = '1'`, run a snapshot test of something that uses `chalk`/`supports-color` for formatting, then revert the `FORCE_COLOR` back again.
This issue probably blocks a fix for https://github.com/babel/babel/issues/12442 . | fixed | github:114 |
| medium | any | \u2014 | Malicious code in supports-color (npm) The package was compromised and malicious code added.
---
_-= Per source details. Do not edit below this line.=-_
## Source: ghsa-malware (52d7b5f7535b1ec1964ec7f0a7019898a143639f62bf70f6a5e6b9e2ca580c12)
Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.
| open | osv:MAL-2025-46981 |
API access
Get this data programmatically \u2014 free, no authentication.
curl https://depscope.dev/api/bugs/npm/supports-color