Source prompt_pwd shorten function from @bjeanes.