mirror of
https://github.com/oh-my-fish/theme-bobthefish.git
synced 2024-10-27 20:34:23 +00:00
Update virtualenv python version prompt
This commit is contained in:
parent
7ff4d6a3b3
commit
01c546af51
@ -83,6 +83,7 @@ set -g theme_display_docker_machine no
|
|||||||
set -g theme_display_k8s_context yes
|
set -g theme_display_k8s_context yes
|
||||||
set -g theme_display_hg yes
|
set -g theme_display_hg yes
|
||||||
set -g theme_display_virtualenv no
|
set -g theme_display_virtualenv no
|
||||||
|
set -g theme_display_virtualenv verbose
|
||||||
set -g theme_hide_python_version yes
|
set -g theme_hide_python_version yes
|
||||||
set -g theme_display_nix no
|
set -g theme_display_nix no
|
||||||
set -g theme_display_ruby no
|
set -g theme_display_ruby no
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
# set -g theme_display_aws_vault_profile yes
|
# set -g theme_display_aws_vault_profile yes
|
||||||
# set -g theme_display_hg yes
|
# set -g theme_display_hg yes
|
||||||
# set -g theme_display_virtualenv no
|
# set -g theme_display_virtualenv no
|
||||||
|
# set -g theme_display_virtualenv verbose
|
||||||
# set -g theme_display_nix no
|
# set -g theme_display_nix no
|
||||||
# set -g theme_display_ruby no
|
# set -g theme_display_ruby no
|
||||||
# set -g theme_display_user ssh
|
# set -g theme_display_user ssh
|
||||||
@ -50,8 +51,6 @@
|
|||||||
# set -g fish_prompt_pwd_dir_length 0
|
# set -g fish_prompt_pwd_dir_length 0
|
||||||
# set -g theme_project_dir_length 1
|
# set -g theme_project_dir_length 1
|
||||||
# set -g theme_newline_cursor yes
|
# set -g theme_newline_cursor yes
|
||||||
# set -g theme_hide_python_version yes
|
|
||||||
|
|
||||||
|
|
||||||
# ==============================
|
# ==============================
|
||||||
# Helper methods
|
# Helper methods
|
||||||
@ -867,14 +866,22 @@ function __bobthefish_prompt_virtualfish -S -d "Display current Python virtual e
|
|||||||
and return
|
and return
|
||||||
|
|
||||||
set -l version_glyph (__bobthefish_virtualenv_python_version)
|
set -l version_glyph (__bobthefish_virtualenv_python_version)
|
||||||
|
set -l prompt_style 'default'
|
||||||
|
|
||||||
if [ "$version_glyph" ]
|
if [ "$version_glyph" ]
|
||||||
__bobthefish_start_segment $color_virtualfish
|
__bobthefish_start_segment $color_virtualfish
|
||||||
if [ "$theme_hide_python_version" = yes ]
|
if string match -q "Python 2*" (python --version 2>&1 | string trim)
|
||||||
echo -ns $virtualenv_glyph
|
set prompt_style 'verbose'
|
||||||
else
|
else if [ "$theme_display_virtualenv" = 'verbose' ]
|
||||||
echo -ns $virtualenv_glyph $version_glyph ' '
|
set prompt_style 'verbose'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if [ "$prompt_style" = 'verbose' ]
|
||||||
|
echo -ns $virtualenv_glyph $version_glyph ' '
|
||||||
|
else
|
||||||
|
echo -ns $virtualenv_glyph
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if [ "$VIRTUAL_ENV" ]
|
if [ "$VIRTUAL_ENV" ]
|
||||||
|
Loading…
Reference in New Issue
Block a user