From 681d02b05aa4e307920b771b8a5117773637e88d Mon Sep 17 00:00:00 2001 From: Liang Bo Wang Date: Sun, 22 Feb 2015 18:17:19 +0800 Subject: [PATCH] Fix python version detection in theme bobthefish Relax the python version matching, so `python` that symlinks to either major versions (e.g. 2, 3) or minor versions (e.g. 2.7, 3.4) can be properly detected. Note that currently both pypy and pypy3 have same display glyph. --- themes/bobthefish/fish_prompt.fish | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/themes/bobthefish/fish_prompt.fish b/themes/bobthefish/fish_prompt.fish index 11faaa7..9daefdc 100644 --- a/themes/bobthefish/fish_prompt.fish +++ b/themes/bobthefish/fish_prompt.fish @@ -327,11 +327,11 @@ end function __bobthefish_virtualenv_python_version -d 'Get current python version' set -l python_version (readlink (which python)) switch "$python_version" - case python2 + case 'python2*' echo $__bobthefish_superscript_glyph[2] - case python3 + case 'python3*' echo $__bobthefish_superscript_glyph[3] - case pypy + case 'pypy*' echo $__bobthefish_pypy_glyph end end