current dir in iTerm tab title

took a lot of trial & error, see https://gist.github.com/phette23/5270658 for details