Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wanted to suppress the current working directory from the prompt for the eshell like i do on the commandline because it takes up a lot of screen space. Using C-h v i check that the default value is:

(lambda nil
       " # " " $ ")))

and I tried changing it to this in my .emacs:

(setq eshell-prompt-function
      (lambda () "> "))

but when I do the above, certain keys break. For example, I can no longer use M-p to browse the previous commands, and C-c C-a will not set point to the beginning of the command im typing like it does with the default prompt. I am wondering why this is happening and if there is a way around it?


share|improve this question
up vote 1 down vote accepted

eshell-bol uses the eshell-skip-prompt function to bypass the prompt. Since you've changed the prompt to end with a > instead of $, you need to change the value of eshell-prompt-regexp. Changing it to ^> should allow it to work.

eshell-prompt-regexp is a variable defined in `em-prompt.el'.
Its value is "^[^#$
]* [#$] "

A regexp which fully matches your eshell prompt.
This setting is important, since it affects how eshell will interpret
the lines that are passed to it.
If this variable is changed, all Eshell buffers must be exited and
re-entered for it to take effect.

You can customize this variable.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.