I use zsh and oh-my-zsh for my shell environment on OS X, and I'm having a hard time tracking down whether or not the thing that is happening is a result of an oh-my-zsh function or the default behavior of zsh; it's entirely a cosmetic issue but it drives me crazy.
The short version is that if I cd
in to a directory, the thing that is printed in my prompt from %c
is exactly the argument that was passed in to cd
; so if I'm changing in to the directory "test" but I spell it "tEst" by accident, then "tEst" is what will show up in my prompt. This is very annoying.
Another example of where it pops up is when I use this shell function (simplified from Brett Terpstra)
cdf()
{
target=`osascript -e 'tell application "Finder" to get POSIX path of (target of front Finder window as text)'`
cd ${target}
}
When I use this function, regardless of what directory I end up in, my working directory is displayed as ~target
in my prompt.
Like I said, these are totally cosmetic issues, but it's driving me crazy. Is this a zsh thing, an oh-my-zsh thing, or is there a different expansion I can use in my prompt settings that would fix this? I'm using iTerm 2 but I've tried it in Terminal.app and the same thing happens.
$PWD
look like when youcd
into these directories? You might be able to use that instead of%c
in your prompt, perhaps after some shell substitution processing.echo $PWD
spits out the same :-/