I have several Lua scripts that run experiences and output a lot of information, in text files and in the console. I'd like to add some colors in the console output, to make it more readable.
I know that it's possible to color the output of bash scripts using the ANSI escape sequences. For example :
$ echo -e "This is red->\e[00;31mRED\e[00m"
I tried to do the same in Lua :
$ lua -e "io.write('This is red->\\e[00;31mRED\\e[00m\n')"
but it does not work. I also tried with print()
instead of io.write()
, but the result is the same.