Add the ability to recover the cwd from shell commands.