diff options
Diffstat (limited to '.config/emacs/modules/bd--shells.el')
-rw-r--r-- | .config/emacs/modules/bd--shells.el | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/.config/emacs/modules/bd--shells.el b/.config/emacs/modules/bd--shells.el index dbf6b67..06e2752 100644 --- a/.config/emacs/modules/bd--shells.el +++ b/.config/emacs/modules/bd--shells.el @@ -34,26 +34,22 @@ (format " %s" (bd/get-prompt-path)) " >\n")) (setopt eshell-prompt-function 'bd/eshell-prompt - eshell-prompt-regexp (rx bol (eval (system-name)) (one-or-more anything) " >\n"))) + eshell-prompt-regexp (rx bol (eval (system-name)) (one-or-more anything) " >\n"))) (use-package eshell :bind (:map eshell-mode-map ("<tab>" . #'completion-at-point) - ("C-l" . #'eshell/clear)) + ("C-l" . #'eshell/clear)) :config (defun eshell/clear (&optional scrollback) - "Override of default function. Scroll contents of eshell window -out of sight, leaving a blank window. If SCROLLBACK is non-nil, -clear the scrollback contents. Outputs banner message." + "Clear the eshell buffer and output the banner message." (interactive) - (if scrollback - (eshell/clear-scrollback) - (let ((eshell-input-filter-functions nil)) - (insert (make-string (window-size) ?\n)) - (eshell-send-input) - (unless eshell-non-interactive-p - (eval eshell-banner-message))))) + (let ((inhibit-read-only t)) + (delete-all-overlays) + (set-text-properties (point-min) (point-max) nil) + (erase-buffer) + (eval eshell-banner-message))) (defun eshell/open (file) (interactive) (find-file file)) @@ -63,19 +59,19 @@ clear the scrollback contents. Outputs banner message." (use-package shell :bind (:map shell-mode-map - ("C-c C-k" . #'comint-clear-buffer)) + ("C-c C-k" . #'comint-clear-buffer)) :config (setopt shell-command-prompt-show-cwd t - shell-highlight-undef-enable t - shell-kill-buffer-on-exit t - comint-prompt-read-only t)) + shell-highlight-undef-enable t + shell-kill-buffer-on-exit t + comint-prompt-read-only t)) (use-package proced :config (add-hook 'proced-mode-hook - (lambda () - (proced-toggle-auto-update 1)))) + (lambda () + (proced-toggle-auto-update 1)))) (provide 'bd--shells) |