I'm trying to get my two-lined eshell prompt working with eshell. It gets displayed alright, and it's also non-readable. But when I call something external, the cursor doesn't jump "down" to the new prompt line, only on internal things. And then hitting return again, it copies the line down - but it copies the full line, not just the actual command. My prompt is:

  (defun shk-eshell-prompt ()
(let ()
   (with-face user-login-name :foreground "blue")
   (with-face "localhost" :foreground "green")
   (with-face ":" :foreground "green")
   (with-face (concat (eshell/pwd) " ") :foreground "green")
   (with-face (format-time-string "(%Y-%m-%d %H:%M) " (current-time)) :foreground "#888")
    (or (ignore-errors (format "(%s)" (vc-responsible-backend default-directory))) ""))
   (with-face "\n")
   (if (= (user-uid) 0)
       (with-face "#" :foreground "red")
   " ")))

The regexp is the following, made with regexp-builder:

"[a-zA-Z]+@[a-zA-Z0-9-_]+:[a-zA-Z0-9-_~/]+ [())(0-9a-zA-Z: -]+
. "

(Quotes for clarification that a whitespace is at the end). Now what's wrong with this regexp? Does the eshell have some sort of a special regex syntax?

1 Answer 1


Ah, it seems like I only have to provide a regexp for the second line! This makes my solution

". "

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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