As most of you know, I’m a big fan of Eshell. It’s easy to pop in and out of it and I really enjoy its tight integration with the rest of Emacs, particularly the ability to cd
to a remote machine.
Still, it’s not a “normal” Unix shell so muscle memory is useless when you want to do things like set an alias, configure the prompt, or enable color output. Fortunately, The Emacs Cat has a helping hand. In a post entitled Eshell Aliases, Prompt, And Colors, The Emacs Cat tells us exactly how to configure these Eshell features.
One thing that the post doesn’t mention is how add an alias directly from Eshell without editing your init.el
or eshell/alias
file. Eshell is famously lacking in documentation and it’s hard to find documentation on setting an Eshell alias. For the record, it’s here.
Setting the prompt is very fussy. Basically, you need to provide a function whose output is the prompt. The post has an example of a complex prompt that’s probably more than most people need but it’s a good go-by.
Finally, enabling color output isn’t hard but requires setting a hook function. All the details are in the post so be sure to take a look.
It’s nice to have this post because it removes some barriers to using Eshell. That is, I think, a good thing because Eshell is a powerful part of Emacs that can make all our workflows more frictionless.