[ckan-dev] [OT] zsh prompt!

Sean Hammond sean.hammond at okfn.org
Mon Apr 1 11:57:48 UTC 2013


Hey all, back at the summit I was using powerline for my zsh prompt and
some others started installing it as well. I've got rid of powerline
since, I found that whenever I ssh'd into my machine from another
machine that didn't have powerline's patched font installed, then I'd
get random unicode characters in my prompt. Also, I was sometimes
getting Python tracebacks in my prompt. And there were other bugs with
it.

But I still wanted a colourful prompt that would show the current active
virtualenv nicely, git branch, non-zero last exist status, and be easy
to find where one command ends and the next begins when scrolling.

Zsh scripting is horrific so I ended up doing it in python, much like
how powerline works, but this is just one little python module that
doesn't require any patched fonts and won't tell you the time of day or
the weather. Think of it as powerline lite. Not as many features but
easier to install and more reliable:

https://gist.github.com/seanh/5233082

It's not customisable yet (although the code is really simple so you
could easily fork and modify it), but I think adding prompt
customisation with command-line arguments probably using python format
strings should be simple enough.




More information about the ckan-dev mailing list