overhaul prompt management; make it easier to add/remove things to {,r}prompt over time
This commit is contained in:
@@ -6,16 +6,12 @@
|
||||
# auto_assign_base: false
|
||||
# changeps1: false
|
||||
|
||||
local orig_rprompt="${RPROMPT}"
|
||||
|
||||
function precmd_conda_prompt() {
|
||||
function conda_prompt() {
|
||||
if [[ -v CONDA_DEFAULT_ENV && "$CONDA_DEFAULT_ENV" != "base" ]]; then
|
||||
RPROMPT="%{$fg[cyan]%}$CONDA_DEFAULT_ENV %{$reset_color%} ${orig_rprompt}"
|
||||
else
|
||||
RPROMPT="${orig_rprompt}"
|
||||
print "%{$fg[cyan]%}$CONDA_DEFAULT_ENV"
|
||||
fi
|
||||
}
|
||||
|
||||
if (( ${+commands[conda]} )); then
|
||||
precmd_functions+=precmd_conda_prompt
|
||||
rprompt_functions+=conda_prompt
|
||||
fi
|
||||
Reference in New Issue
Block a user