mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-05-11 05:55:37 +00:00
themes/luan: Define python venv as optional
Co-authored-by: Koichi Murase <myoga.murase@gmail.com>
This commit is contained in:
@ -85,6 +85,8 @@ CONDAENV_THEME_PROMPT_SUFFIX='|'
|
||||
PYTHON_THEME_PROMPT_PREFIX=' |'
|
||||
PYTHON_THEME_PROMPT_SUFFIX='|'
|
||||
|
||||
OMB_PROMPT_SHOW_PYTHON_VENV=${OMB_PROMPT_SHOW_PYTHON_VENV:=true}
|
||||
|
||||
## @fn _omb_prompt_format var value fmt_prefix[:deprecated]
|
||||
## @param[in] var
|
||||
## @param[in] value
|
||||
@ -467,6 +469,8 @@ function _omb_prompt_get_python_version {
|
||||
}
|
||||
|
||||
function _omb_prompt_get_python_venv {
|
||||
python_venv=
|
||||
[[ ${OMB_PROMPT_SHOW_PYTHON_VENV-} == true ]] || return 1
|
||||
local virtualenv condaenv
|
||||
_omb_prompt_get_virtualenv
|
||||
_omb_prompt_get_condaenv
|
||||
|
@ -64,6 +64,9 @@ OSH_THEME="font"
|
||||
# this variable. The default behavior for the empty value is "true".
|
||||
OMB_USE_SUDO=true
|
||||
|
||||
# To disable display of Python virtualenv
|
||||
# OMB_PROMPT_SHOW_PYTHON_VENV=false
|
||||
|
||||
# Which completions would you like to load? (completions can be found in ~/.oh-my-bash/completions/*)
|
||||
# Custom completions may be added to ~/.oh-my-bash/custom/completions/
|
||||
# Example format: completions=(ssh git bundler gem pip pip3)
|
||||
|
@ -10,6 +10,9 @@ GIT_THEME_PROMPT_CLEAN=" ${_omb_prompt_bold_green}✓"
|
||||
GIT_THEME_PROMPT_PREFIX="(${_omb_prompt_olive}"
|
||||
GIT_THEME_PROMPT_SUFFIX="${_omb_prompt_normal})"
|
||||
|
||||
VIRTUALENV_THEME_PROMPT_PREFIX='('
|
||||
VIRTUALENV_THEME_PROMPT_SUFFIX=') '
|
||||
|
||||
RVM_THEME_PROMPT_PREFIX=""
|
||||
RVM_THEME_PROMPT_SUFFIX=""
|
||||
|
||||
@ -18,12 +21,13 @@ function _omb_theme_PROMPT_COMMAND() {
|
||||
user_host="${_omb_prompt_green}\u@${_omb_prompt_teal}\h${_omb_prompt_normal}"
|
||||
current_dir="${_omb_prompt_bold_navy}\w${_omb_prompt_normal}"
|
||||
rvm_ruby="${_omb_prompt_bold_brown}$(_omb_prompt_print_ruby_env)${_omb_prompt_normal}"
|
||||
python_venv="$(_omb_prompt_print_python_venv)"
|
||||
git_branch="$(scm_prompt_info)${_omb_prompt_normal}"
|
||||
prompt="${_omb_prompt_bold_green}\$${_omb_prompt_normal} "
|
||||
arrow="${_omb_prompt_bold_white}▶${_omb_prompt_normal} "
|
||||
prompt="${_omb_prompt_bold_green}\$${_omb_prompt_normal} "
|
||||
|
||||
PS1="${dtime}${user_host}:${current_dir} ${rvm_ruby} ${git_branch}
|
||||
PS1="${dtime}${python_venv}${user_host}:${current_dir} ${rvm_ruby} ${git_branch}
|
||||
$arrow $prompt"
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user