(define-key eshell-mode-map (kbd "<home>") 'eshell-bol))
(add-hook 'eshell-mode-hook 'my-setup-eshell)
+
+(defun eshell-switch-directory-current-buffer ()
+ (interactive)
+ (let ((dir default-directory)
+ (eshell-buffer (get-buffer "*eshell*")))
+ (if (not eshell-buffer)
+ (error "no *eshell* buffer found"))
+ (pop-to-buffer (get-buffer "*eshell*"))
+ (goto-char (point-max))
+ (setq default-directory dir)
+ (insert "\n")
+ (eshell-send-input)))
+
+(global-set-key "\C-cE" 'eshell-switch-directory-current-buffer)