1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Tweak how eshell/cd works when cd-ing to ".." from "/"

* lisp/eshell/em-dirs.el (eshell/cd): Make "cd .." from "/" less
confusing (bug#16861).
This commit is contained in:
Lars Ingebrigtsen 2022-02-05 23:57:38 +01:00
parent a4eeea8124
commit 93da7a202d

View file

@ -391,6 +391,10 @@ in the minibuffer:
(unless (equal curdir newdir)
(eshell-add-to-dir-ring curdir))
(let ((result (cd newdir)))
;; If we're in "/" and cd to ".." or the like, make things
;; less confusing by changing "/.." to "/".
(when (equal (file-truename result) "/")
(setq result (cd "/")))
(and eshell-cd-shows-directory
(eshell-printn result)))
(run-hooks 'eshell-directory-change-hook)