11 comments

[ 3.2 ms ] story [ 22.8 ms ] thread
Can someone comment on how to get better colors on eshell?

The only thing that stops me from using it is that xterm-256color and ansi-color and all the articles on the web talking about colors ultimately say this - the terminal emulator that it ships with just cannot do better colors?

(Eg when you do a ‘cargo run’ for rust, the error colors aren’t even highlighted in eshell)

(comment deleted)
https://github.com/atomontage/xterm-color

That looked like the way to do it but I haven't tried yet.

I tried and it mostly works, but for rustc/cargo in particular you also have to set the $TERM environment variable to "xterm" [1].

[1] https://github.com/rust-lang/rust/issues/45728#issuecomment-...

Interestingly, I've gotten used to checking $TERM and making sure it's set due to entering Docker containers to poke around them: in a lot of images, it's unset, and you get really old-school terminal emulator behaviour without it!
Eshell has a lot of potential, but it needs a bit more polish and documentation. It's sort of an unfinished part of Emacs.

People often take it for a terminal emulator, which is not, and get frustrated when typical ncurses applications don't run properly.

Yep. My Emacs workflow is a lot like my old terminal workflow, but now it's Emacs+packages instead of terminal+ncurses apps. If you try to do a lot of terminal emulation inside Emacs you'll probably have a bad time.
I try to use eshell for whatever I can (some things still work better in a standard terminal), so I wrote Equake, a drop-down console (with tabs) in Emacs Lisp for eshell (though it can also open term or shell tabs as well):

https://gitlab.com/emacsomancer/equake (link include animated gifs of Equake in action)

A minor addition to what the article says about ipython: You can run arbitrary shell commands there without system() by prefixing them with !. It even supports using python variables as in `a = "some_dir"; ! cd $a`.