fix(eshell): disable undo while process is executing

After further experimentation these will be replaced with named
functions.
This commit is contained in:
Henrik Lissner
2025-06-01 00:25:58 +02:00
parent 96ac6b0037
commit 6a6ac8f315

View File

@ -85,6 +85,16 @@ You should use `set-eshell-alias!' to change this.")
(add-hook 'eshell-mode-hook #'+eshell-init-h)
(add-hook 'eshell-exit-hook #'+eshell-cleanup-h)
;; UX: Temporarily disable undo history between command executions. Undo can
;; destroy output while it's being printed to stdout.
(let (old-undo-list)
(add-hook! 'eshell-pre-command-hook
(setq old-undo-list buffer-undo-list
buffer-undo-list nil))
(add-hook! 'eshell-post-command-hook
(setq buffer-undo-list old-undo-list)
(clrhash undo-equiv-table)))
;; Enable autopairing in eshell
(add-hook 'eshell-mode-hook #'smartparens-mode)