I'm new to Emacs and am trying to use eshell. Unfortunately, when I have errors in a C file, for example, I receive some odd error output (this is just an example; the particular error isn't important):
^[[1m2-2.c:18:18: ^[[0m^[[0;1;31merror: ^[[0m^[[1mexpected ';' after expression^[[0m
c = getchar()
^[[0;1;32m ^
^[[0m^[[0;32m ;
^[[0m^[[1m2-2.c:21:5: ^[[0m^[[0;1;31merror: ^[[0m^[[1muse of undeclared identifier 's'^[[0m
s[i] = c;
^[[0;1;32m ^
^[[0m2 errors generated.
I'm not sure what all of this means. I'm using zsh, rather than normal bash, so maybe that has something to do with it?
If I run the same file in my normal terminal, of course I still receive errors, but it is readable.
This is your compiler trying to be nice and format the output using color and things like bold font face. What's strange is that it should work just fine out of the box. Try inspecting the
eshell-output-filter-functions
variable:For me, the value of the variable is
If you miss some of those elements from the list, try adding them manually:
If you're using an older version of Emacs, there will be no functions like
eshell-handle-control-codes
and you will have to define them yourself. See this wiki page for an example.PS. This is probably unrelated, but you should give compilation mode a try.
M-x compile
.