From a09033b9259b6791cbfff0b040bb6f17adfbb636 Mon Sep 17 00:00:00 2001 From: MitchMarq42 Date: Wed, 8 Feb 2023 14:01:27 -0900 Subject: [PATCH] Sticky Shell: show previous prompt in header-line --- lisp/mitch-packages.el | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lisp/mitch-packages.el b/lisp/mitch-packages.el index bd7de17..49a0f80 100644 --- a/lisp/mitch-packages.el +++ b/lisp/mitch-packages.el @@ -232,6 +232,30 @@ If the current window occupies the whole frame, split it." (kbd "RET") 'hkey-either)) (advice-add 'evil-collection-eshell-setup-keys :after 'mitch/eshell-setup-keys)) +;; show command that caused last scrollback in eshell etc +(elpaca-use-package (sticky-shell + :host github + :repo "andyjda/sticky-shell") + :after eshell + :config + (defun esh--turn-off-sticky-shell () + "Disable `sticky-shell-mode'." + (sticky-shell-mode -1)) + (defun esh--turn-on-sticky-shell () + "Enable `sticky-shell-mode'." + (sticky-shell-mode 1)) + (defun mitch/sticky-shell-refresh () + "Only turn on sticky-shell if the prompt is at the bottom line of window." + (if (>= (line-number-at-pos (point)) (window-height)) + (esh--turn-on-sticky-shell) + (esh--turn-off-sticky-shell))) + (add-hook 'eshell-post-command-hook #'mitch/sticky-shell-refresh) + ;; https://emacs.ch/@bram85/109612654687707030 + (defun mitch/esh-outline-setup () + (outline-minor-mode) + (setq-local outline-regexp eshell-prompt-regexp)) + (add-hook 'eshell-mode-hook #'mitch/esh-outline-setup)) + (elpaca-use-package (eat :repo "https://codeberg.org/akib/emacs-eat"