Things have changed in Eshell a little so here is my updated working solution for using helm-eshell-history
;; the powerline prompt is best but I've no idea how to shorten it to the last directory.
You can use M-| (shell-command-on-region).
Within eshell, you can use
~ $ (with-current-buffer "*scratch*" (buffer-string)) | nl
1 ;; This buffer is for text that is not saved, and for Lisp evaluation.
2 ;; To create a file, visit it with <open> and enter text in its buffer.
Eshell commands are Emacs functions, e.g,.
(defun kitty ...