Also, the code is now used in the liquid prompt: https://github.com/nojhan/liquidprompt/commit/91959b636af751...