dotfiles/emacs/.emacs.d/init/oni-eshell-init.org

636 B

Eshell configuration

  (require 'eshell)

Truncate the eshell buffer when it gets larger than eshell-buffer-maximum-lines number of lines. For some reason I have to use the eshell-load-hook instead of just relying on eshell.el and esh-mode.el being loaded because it seems that with-eval-after-load loads this file before eshell.el is actually loaded.

  (defun oni:enable-truncating-eshell-buffers ()
    (add-to-list 'eshell-output-filter-functions 'eshell-truncate-buffer))

  (add-hook 'eshell-load-hook #'oni:enable-truncating-eshell-buffers)