Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions themes/base.theme.bash
Original file line number Diff line number Diff line change
Expand Up @@ -604,3 +604,11 @@ function _save-and-reload-history() {
[[ ${autosave} -eq 1 ]] && local HISTCONTROL="${HISTCONTROL:-}${HISTCONTROL:+:}autoshare"
_bash-it-history-auto-save && _bash-it-history-auto-load
}

function conda_or_venv_prompt() {
if [[ -n "${CONDA_DEFAULT_ENV:-}" ]]; then
condaenv_prompt
elif [[ -n "${VIRTUAL_ENV:-}" ]]; then
virtualenv_prompt
fi
}
5 changes: 4 additions & 1 deletion themes/robbyrussell/robbyrussell.theme.bash
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@
RVM_THEME_PROMPT_PREFIX="|"
RVM_THEME_PROMPT_SUFFIX="|"

VIRTUALENV_THEME_PROMPT_PREFIX='('

Check warning

Code scanning / shellcheck

SC2034 Warning

VIRTUALENV_THEME_PROMPT_PREFIX appears unused. Verify use (or export if used externally).
VIRTUALENV_THEME_PROMPT_SUFFIX=') '

Check warning

Code scanning / shellcheck

SC2034 Warning

VIRTUALENV_THEME_PROMPT_SUFFIX appears unused. Verify use (or export if used externally).

function git_prompt_info() {
git_prompt_vars
echo -e "$SCM_PREFIX${bold_red}$SCM_BRANCH$SCM_STATE$SCM_SUFFIX"
}

function prompt_command() {
PS1="${bold_green}${bold_cyan}\W${reset_color}$(scm_prompt_info)${normal} "
PS1="$(conda_or_venv_prompt)${bold_green}${bold_cyan}\W${reset_color}$(scm_prompt_info)${normal} "
}

PROMPT_COMMAND=prompt_command
Loading