The shell function overrides suggested in term.el to facilitate directory tracking cause those commands to return a success status unconditionally: cd() { command cd "$@"; printf '\033AnSiTc %s\n' "$PWD"; } pushd() { command pushd "$@"; printf '\033AnSiTc %s\n' "$PWD"; } popd() { command popd "$@"; printf '\033AnSiTc %s\n' "$PWD"; } I.e. if the 'cd' fails, we are ignoring that and instead returning the 'printf' exit status. I believe these should be: cd() { command cd "$@" && printf '\033AnSiTc %s\n' "$PWD"; } pushd() { command pushd "$@" && printf '\033AnSiTc %s\n' "$PWD"; } popd() { command popd "$@" && printf '\033AnSiTc %s\n' "$PWD"; } If the command fails, no dir-tracking update should be needed in Emacs (so it's fine not to do that part), and we will see the exit status for the original command, so I think this is all that's required. Patch attached. -Phil