How to Clear the Eshell

I’m a big fan of Eshell, but some things in Eshell look, hmm, a bit strange. One of such things is how the Eshell’s command clear clears the screen.

As it is decribed at the Unix Wiki page, clear is a computer operating system command which is used to bring the command line on top of the computer terminal. The key words are “bring the command line on top”.

The Eshell’s clear works in a different way, it brings the command prompt on bottom, instead.

Using the `clear` command to clear the Eshell screen.

After the `clear`, the command prompt has been moved on bottom.

Just recently, I’ve accidently discovered an unexpected, at least for me, workaround (from this Stackexchange thread). To clear the Eshell screen you just need to type clear 1 instead of just clear.

Using the `clear 1` command to clear the Eshell screen.

After the `clear 1`, it's OK now.

Of course, then I’ve immediately added an alias for clear 1 to my Eshell aliases configuration file ~/.emacs.d/eshell/alias.

alias cls clear 1

More on Eshell aliases you can find in my post Eshell Aliases, Prompt, And Colors.

Perhaps you can use this trick for your eshelling.