Reproduce: (assume ~/bin exists) 1. M-x shell RET 2. cd ~//bin RET 3. M-: default-directory RET Expected: default-directory is ~/bin Actual: default-directory is /bin It seems like the directory tracker uses Emacs's convention for double slashes "resetting" a path to root, but most shells treat double slashes the same as single slashes. It looks like this should be fixed in `shell-cd` (which should also fix `shell-process-pushd`) by implementing "custom" path handling (compared to Emacs default path handling behavior). In GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, cairo version 1.16.0) of 2023-09-03, modified by Debian built on kokoro-ubuntu Windowing system distributor 'The X.Org Foundation', version 11.0.12101007 System Description: Debian GNU/Linux rodete