You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On windows, ansis.isSupported() returns true when redirecting stdout to a file. On mac (and I'm assuming linux) it returns false.
This leads to ansi characters showing up in the file containing the redirected stdout. For example:
�[1mhello world�[22m
Expected behaviour
I expect ansis.isSupported() to return false when redirecting stdout to a file, regardless of operating system. This would be consistent with the supports-color package
- chore: optimize code to reduce the size by ~50 bytes
- chore: add benchmarks for `kolorist` package
- test: add test matrix for windows on GitHub
- docs: add compare the size of most popular packages
Current behaviour
On windows,
ansis.isSupported()
returnstrue
when redirecting stdout to a file. On mac (and I'm assuming linux) it returnsfalse
.This leads to ansi characters showing up in the file containing the redirected stdout. For example:
Expected behaviour
I expect
ansis.isSupported()
to returnfalse
when redirecting stdout to a file, regardless of operating system. This would be consistent with the supports-color packageReproduction Example
git clone https://github.com/mdonnalley/ansis-bug.git
cd ansis-bug
npm install
node index.js > output.txt
On windows:
On mac:
Environment
Additional context
NA
The text was updated successfully, but these errors were encountered: