[Tmux](http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/tmux.1?query=tmux&sec=1) has an option to have the `#{pane_current_path}` as a name for the current pane in the status line. This is great but has two short falls for me:

1. `$HOME` is not displayed as `~`.
2. I only really need the last directory name, not the full path from `/`. So, for example `/home/ook/thingy/src` would only be displayed as either `src` or `~/t/src`.

Is there a [Tmux](http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/tmux.1?query=tmux&sec=1) command that does this?

Bonus points if it works with [powerline](https://github.com/powerline/powerline) as well.