Eshell: Fix global history setup on first start

master
Pierre Neidhardt 2018-01-12 11:27:11 +01:00
parent 7b0a6cedbf
commit 32232ac81f
1 changed files with 3 additions and 5 deletions

View File

@ -212,11 +212,9 @@
(defun eshell-hist-use-global-history ()
"Make Eshell history shared across different sessions."
(unless eshell-history-global-ring
(let (eshell-history-ring)
(when eshell-history-file-name
(eshell-read-history nil t))
(setq eshell-history-global-ring eshell-history-ring))
(unless eshell-history-ring (setq eshell-history-global-ring (make-ring eshell-history-size))))
(when eshell-history-file-name
(eshell-read-history nil t))
(setq eshell-history-global-ring (or eshell-history-ring (make-ring eshell-history-size))))
(setq eshell-history-ring eshell-history-global-ring))
(add-hook 'eshell-mode-hook 'eshell-hist-use-global-history)