0

I have a bash script where I echo out some coloured text at the start like so:

echo "\033[1;31mACTION REQUIRED: \033[0m"

And I see that coloured as expected when I run the script from my terminal

enter image description here

But running as an npm script it ignores the colour expressions, so I just see the literal colour char sequences

enter image description here

How do I get these to behave when executing in the content of an npm script?

mindparse
  • 6,115
  • 27
  • 90
  • 191
  • Does this answer your question? [No console colors if using npm script inside a Git bash (mintty)](https://stackoverflow.com/questions/32742865/no-console-colors-if-using-npm-script-inside-a-git-bash-mintty) – 0stone0 Jun 14 '23 at 09:48
  • 2
    Use `printf` instead. `echo` does not evaluate escape sequences (like `\e`) on all platforms. On macOS your command will work, for example, but on linux it won't unless you use the `-e` flag. – oguz ismail Jun 14 '23 at 10:03

0 Answers0