cygwin bash does not display correctly in emacs shell
A "known problem," with no known solution (yet):
If nothing else works, you can customise your shell prompt for the case when you are running M-x shell
by making use of the following functionality:
M-: (info "(emacs) Interactive Shell")
RET
Emacs sends the new shell the contents of the file
~/.emacs_SHELLNAME' as input, if it exists, where SHELLNAME is the name of the file that the shell was loaded from. For example, if you use bash, the file sent to it is
~/.emacs_bash'. If this file is not found, Emacs tries with `~/.emacs.d/init_SHELLNAME.sh'.
So you can specify a prompt without colour codes in that file (i.e. set the PS1
environment variable).