-
-
Notifications
You must be signed in to change notification settings - Fork 937
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(2148): don't remove ANSI colour codes from script output #4559
Conversation
💖 Thanks for opening this pull request! 💖 |
I don't think it works. |
The failed CI was due to a code style issue (my IDE inserted a semicolon when autocompleting the import). I've removed it so it should be okay now. |
What command have you used to check if the colors are preserved? I tried to test it but the colors were not preserved. |
I noticed while trying to fix this issue, that pnpm seems to call its own binary So I had to uninstall my existing pnpm installation and then use Could this be the reason you're not seeing the colours? |
Oh, I see where the confusion comes from. This fix just makes it so that colour information isn't stripped on pnpm's side. Other scripts can still detect that they're not running in an interactive shell and so they don't use colours by default. Most packages use I had npx cross-env FORCE_COLOR=1 node packages/pnpm/dist/pnpm.cjs -r test Note: |
Makes sense. In that case, it works. Please add some changesets. Run And looks like something is failing. |
Should pnpm set FORCE_COLOR=1 for the scripts that it runs? |
Would love to get an update on this if possible. Am running 4 different projects concurrently with |
If I recall correctly, the cause of the problem was identified and a fix for it should be implemented in this PR. I needed to look into the failing tests but couldn't get the tests to run properly on my machine and then this kinda fell by the wayside as other work picked up. I don't have the bandwidth right now to dive back into this codebase. So if anyone wants to help out, feel free to take over. Otherwise it will just remain on my to-do list. |
so how to fix this broken output: #4559 (comment) ? |
…ve ANSI escape codes in script output
be3bdb4
to
0271264
Compare
I can merge it as it doesn't seem to break anything. However, the output doesn't always work as you can see in my comment: #4559 (comment) |
Congrats on merging your first pull request! 🎉🎉🎉 |
Reflecting my comment in #2148, I've replaced the use of
strip-ansi
before truncating a line (which removed all colour codes in script output) withcli-truncate
which is aware of ANSI escape codes.