Ideally, this line of PolyML code should give desired result:
print "\033[31m RED \033[0m NORMAL \n";
But the \033 turns out to be just an exclamation mark, not a special symbol for color encoding. I use the following "way-around" approach, but it doesn't allow to do anything interactively: I just take the output of my program and color it.
echo "\\\\033[31m RED \\\\033[0m NORMAL \\\\n" | xargs echo -e
What are the possible solutions to this problem? Is it possible to solve it within the standard PolyML instruments?
added: I checked how Ocaml do the same thing with
Printf.printf "\033[31m RED \033[0m NORMAL \n";;
-- situation is the same: no color obtained.
p.s. this question is not a dublicate because it is about differences between echo -e and print in ML languages