nojhan/liquidprompt — pull request #20 by ldidry (2012-08-11 23:06:37+00:00)
Title: Liquidprompt for bash AND zsh

The script now can be sourced from either bash and zsh
No more shebang (it wasn't logical anymore since we don't know if the used shell is bash or zsh).
Small modif on __cpunum_Linux() (add quotes to protect the pattern)
Changes the root prompt with red # instead of red $, with builtins commands (\$ and %(!.#.$)). Just a preference, can be removed.

I changed the shorten_path function for zsh cause I didn't succeed to make it work correctly, so I didn't print the end of the path beginning with a slash, but by cutting a path.
Example :
BASH :
[luc:~/tmp/ … /fffffffffffffffff/gggggggggggggggg/ff/gg] $
ZSH :
[luc:~/tmp/ … eeeeeeeeeeeeeeeeeeeee/fffffffffffffffff/gggggggggggggggg/ff/gg] $

I'm no expert of zsh (Perl is the only language ;)), so it may not be optimal and could use some testers !