Shell Color MinGW / MSYS

I want my make file to be color coded.

But I can not get the ANSI color codes to work on this terminal. This should be possible, although ls --colorit gives me a vivid conclusion, as well as an invitation to the shell shell:

$ echo $PS1
\[\033]0;$MSYSTEM:\w\007 \033[32m\]\u@\h \[\033[33m\w\033[0m\] $

I suspect that perhaps the first section puts the terminal in special mode so that it accepts color codes. Can someone explain?

+3
source share
1 answer

I solved it.

Team used echo -e.

So, in the make file:

foo.o: foo.c
    @echo -e "\033[32mCompiling foo.c\033[0m"
    $(CC) $(CFLAGS) -c -o $@ $<

I would suggest that this works fine in bash too.

+6
source

All Articles