From: Iain Patterson <me@iain.cx>
Date: Sat, 8 May 2021 09:05:41 +0000 (+0200)
Subject: PYENV prompt.
X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;ds=sidebyside;p=profile.git

PYENV prompt.
---

diff --git a/.ps1.d/pyenv.ps1 b/.ps1.d/pyenv.ps1
new file mode 100644
index 0000000..e551f37
--- /dev/null
+++ b/.ps1.d/pyenv.ps1
@@ -0,0 +1,14 @@
+#!bash
+
+# This part of the prompt is shown only if __ps1_pyenv is 1.  The default is 0.
+
+__ps1_pyenv=${__ps1_pyenv:-0}
+__ps1_pyenv_colour256="0;38;5;227"
+__ps1_pyenv_colour88="0;38;5;77"
+__ps1_pyenv_colour="0;33"
+
+function __ps1_pyenv() {
+  [ "$__ps1_pyenv" = "1" ] || return $1
+  [ -n "$PYENV_VERSION" ] && echo "$(__ps1_prefix $1 __ps1_pyenv)$PYENV_VERSION"
+  return $1
+}