                   (backward-word)
                   (max (point) start))))
     (kill-region start end)))
+
+(defun eshell-clear-before-line ()
+  (interactive)
+  (let ((start (+ (line-beginning-position)
+                  (length (funcall eshell-prompt-function))))
+        (end (point)))
+    (delete-region start end)))
 
 ;;; ============================= shell comint =============================
 ;;; shell

          (lambda ()
            (shell-like-map-setup eshell-mode-map)
            (evil-define-key 'insert eshell-mode-map
              (kbd "C-a") 'eshell-bol
              (kbd "C-r") 'eshell-find-history
              (kbd "C-p") 'eshell-previous-matching-input-from-input

  (let ((inhibit-read-only t))
    (erase-buffer)))

;;;
(defun hong-backward-kill-word ()
  (interactive)
  (let* ((start (+ (line-beginning-position)
