Tags: patch This patch just adds some tests so I don't think that should be too controversial I have included some comments in the patch that I would like to talk about though. In the test `em-hist-test/eshell-history-file-name/nil' we don't save any history to a file because `eshell-history-file-name' is nil and the environment variable HISTFILE is unset. I would like to see some user visible warning here. In theory this could be intended behavior to prevent any history from being saved to disk but I think the more likely case is the user accidentally misconfigured it. I added a comment to the existing test `em-hist-test/write-history/overwrite-multiple-shells' as I don't like the behavior it demonstrates. I was experiencing the occasional history loss for years before I finally decided to investigate and now I know to set `eshell-history-append' to true. While writing this email I discovered Bug#66700 which seemed to come to the conclusion that we should set `eshell-history-append' to true in the next version of Emacs. However, this would effectively make `eshell-hist-ignoredups' useless. I would be interested in a solution where we check if the histfile has been updated to make sure we overwrite without history loss.