diff --git a/dotfiles/system/etc/zsh/zshrc b/dotfiles/system/etc/zsh/zshrc index a8e4b3f..4f9b234 100644 --- a/dotfiles/system/etc/zsh/zshrc +++ b/dotfiles/system/etc/zsh/zshrc @@ -130,7 +130,7 @@ function mkvoid () { mkdir -p "${__MKVOID_DIR}" || die "mkdir fs" ln -s "${__MKVOID_ID}" "${__MKVOID_PATH}" || die "ln" pushd "${__MKVOID_PATH}" > /dev/null || die "pushd" - zsh + OVER_PROMPT_VOIDS="$OVER_PROMPT_VOIDS:$__MKVOID_NAME" zsh popd > /dev/null rm -f "${__MKVOID_PATH}" || die "rm link" rm -rf "${__MKVOID_ID}" || die "rm void" diff --git a/libexec/render.py b/libexec/render.py index 170e978..8e7e7f3 100755 --- a/libexec/render.py +++ b/libexec/render.py @@ -359,6 +359,27 @@ class VirtualEnvPart(Part): self.fragments.append(venv_name) self.fragments.append(style_reset()) +class VoidPart(Part): + """ + ∅ name + + Displays the name(s) of the VOIDs held by the current shell and its ancestors. + """ + + def __init__(self): + Part.__init__(self) + + voids = os.getenv("OVER_PROMPT_VOIDS") + + if voids: + self.fragments.append("∅ ") + + for void in voids.split(":"): + if void: + self.fragments.append(style_color(COLOR_OK)) + self.fragments.append(void) + self.fragments.append(style_reset()) + class WineprefixPart(Part): """ ♿ name:[32|64] @@ -652,12 +673,13 @@ if __name__ == "__main__": lp = LoginPart(settings, sysload) pp = PathPart(settings, overloaded) gp = "" if overloaded else GitPart() - vp = VirtualEnvPart() + vep = VirtualEnvPart() + vop = VoidPart() wp = WineprefixPart() pad = Padding(settings.term_width) sp = StatsPart(settings, sysload) - line = [lp, pp, gp, vp, wp, pad, sp] + line = [lp, pp, gp, vep, vop, wp, pad, sp] pp.shrink_fit(line) pad.expand_fit(line)