(Using latest OS X and latest emacs available on homebrew) Inside emacs when I do
M-x shell
And then launch a REPL console with
rails console
I get
bash-3.2$ rails c
Loading development environment (Rails 5.0.0)
^[[0G[1] pry(main)>
Instead of nice colors, I see ^[[0G[1] How can I fix this?
In emacs,
gives you a "dumb" shell which does not interpret escape codes. You could do
but should be aware that the escape sequence used by rails is not supported by that, either. It is a control sequence (with an incorrect parameter, by the way) which would move the cursor to the first column — on some terminals, such as xterm.
You'd typically see behavior like that from a hard-coded application, and if you're patient, a bug report to its developer might be productive.
Further reading: