kyagi / shell-pop-el

shell-pop.el helps you to use shell easily on Emacs. Only one key action to work.
212 stars 21 forks source link

add-hook for eshell-exit-hook causes eshell to not write history out. #66

Open natemoseman opened 4 years ago

natemoseman commented 4 years ago

There was a bug filed for spacemacs. I think that shell-pop-el is the source of the problem. https://github.com/syl20bnr/spacemacs/issues/8538

In shell-pop.el in the function shell-pop--set-exit-action it checks if the shell is eshell or not. If it is a eshell then it runs the add-hook function:

(add-hook 'eshell-exit-hook 'shell-pop--kill-and-delete-window nil t)

I think this causes eshell to exit before history gets written out. Changing the 'nil' to 't' appends the hook so the history gets saved.

(add-hook 'eshell-exit-hook 'shell-pop--kill-and-delete-window t t)

I am not a elisp programmer so I don't know if this is a 100% correct solution, but it works for me.

asok commented 2 years ago

I can confirm that changing nil to t helps in this matter.