Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make displaying python version glyph in virtualenv segment configurable #346

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion functions/fish_prompt.fish
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
# set -g theme_display_aws_vault_profile yes
# set -g theme_display_hg yes
# set -g theme_display_virtualenv no
# set -g theme_display_virtualenv_python_version no
# set -g theme_display_nix no
# set -g theme_display_ruby no
# set -g theme_display_user ssh
Expand Down Expand Up @@ -849,6 +850,9 @@ function __bobthefish_prompt_rubies -S -d 'Display current Ruby information'
end

function __bobthefish_virtualenv_python_version -S -d 'Get current Python version'
[ "$theme_display_virtualenv_python_version" = 'no' ]
and return

switch (python --version 2>&1 | tr '\n' ' ')
case 'Python 2*PyPy*'
echo $pypy_glyph
Expand All @@ -867,7 +871,7 @@ function __bobthefish_prompt_virtualfish -S -d "Display current Python virtual e

set -l version_glyph (__bobthefish_virtualenv_python_version)

if [ "$version_glyph" ]
if [ "$version_glyph" -o "$theme_display_virtualenv_python_version" = 'no' ]
__bobthefish_start_segment $color_virtualfish
echo -ns $virtualenv_glyph $version_glyph ' '
end
Expand Down