PYENV prompt.
[profile.git] / .ps1.d / pyenv.ps1
diff --git a/.ps1.d/pyenv.ps1 b/.ps1.d/pyenv.ps1
new file mode 100644 (file)
index 0000000..e551f37
--- /dev/null
@@ -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
+}