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

modern theme, added virtualenv name display, changed first bracket and second bracket #1812

Merged
merged 5 commits into from
Jan 26, 2021
Merged
Changes from 2 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
27 changes: 14 additions & 13 deletions themes/modern/modern.theme.bash
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,23 @@ modern_scm_prompt() {
fi
}

prompt() {
if [ $? -ne 0 ]
NoahGorny marked this conversation as resolved.
Show resolved Hide resolved
then
# Yes, the indenting on these is weird, but it has to be like
# this otherwise it won't display properly.

PS1="${TITLEBAR}${bold_red}┌─${reset_color}$(modern_scm_prompt)[${cyan}\W${normal}][$(battery_charge)]$(is_vim_shell)
${bold_red}└─▪${normal} "
else
PS1="${TITLEBAR}┌─$(modern_scm_prompt)[${cyan}\W${normal}][$(battery_charge)]$(is_vim_shell)
└─▪ "
detect_venv() {
python_venv=""
# Detect python venv
if [[ -n "${CONDA_DEFAULT_ENV}" ]]; then
python_venv="($PYTHON_VENV_CHAR${CONDA_DEFAULT_ENV})"
elif [[ -n "${VIRTUAL_ENV}" ]]; then
python_venv="($PYTHON_VENV_CHAR$(basename "${VIRTUAL_ENV}"))"
fi

}
prompt() {
detect_venv

PS2="└─▪ "
PS1="${TITLEBAR}┌─$(modern_scm_prompt)[${cyan}\u${normal}][${cyan}\w${normal}]$(is_vim_shell)\n└─▪ ${python_venv}${dir_color} "

NoahGorny marked this conversation as resolved.
Show resolved Hide resolved
}

PS2="└─▪ "

safe_append_prompt_command prompt
safe_append_prompt_command prompt
NoahGorny marked this conversation as resolved.
Show resolved Hide resolved