PYENV prompt. master
authorIain Patterson <me@iain.cx>
Sat, 8 May 2021 09:05:41 +0000 (11:05 +0200)
committerIain Patterson <me@iain.cx>
Mon, 10 May 2021 11:35:45 +0000 (13:35 +0200)
.ps1.d/pyenv.ps1 [new file with mode: 0644]

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
+}