I have a fix for this, but I'd like for someone else to look over it and perhaps sanity check it before I commit it. Volunteers? This is a very old limitation. Let's say I have three directories in my shell buffer directory stack: /s/software/wwwroot/Java Development Kit /s/software/wwwroot/Perl Compatible Regular Expressions ~/src/build/depot/main/tools/build If I run M-x shell-resync-dirs, I simply get the error: Couldn’t cd: (error No such directory found via CDPATH environment variable) because the directory "/s/software/wwwroot/Java" doesn't exist. The parser considers whitespace to be a separator between directory tokens. This version handles that case. Diff and full function attached below.