mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-18 20:00:07 +00:00
af-magic: account for active conda envs in dash line
See https://github.com/ohmyzsh/ohmyzsh/issues/8081#issuecomment-632182715
This commit is contained in:
parent
25d0b2dfbd
commit
b721053c87
1 changed files with 8 additions and 3 deletions
|
@ -10,9 +10,14 @@ typeset +H my_orange="$FG[214]"
|
||||||
|
|
||||||
# separator dashes size
|
# separator dashes size
|
||||||
function afmagic_dashes {
|
function afmagic_dashes {
|
||||||
[[ -n "${VIRTUAL_ENV-}" && -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" && "$PS1" = \(* ]] \
|
local PYTHON_ENV="$VIRTUAL_ENV"
|
||||||
&& echo $(( COLUMNS - ${#VIRTUAL_ENV} - 3 )) \
|
[[ -z "$PYTHON_ENV" ]] && PYTHON_ENV="$CONDA_DEFAULT_ENV"
|
||||||
|| echo $COLUMNS
|
|
||||||
|
if [[ -n "$PYTHON_ENV" && "$PS1" = \(* ]]; then
|
||||||
|
echo $(( COLUMNS - ${#PYTHON_ENV} - 3 ))
|
||||||
|
else
|
||||||
|
echo $COLUMNS
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# primary prompt
|
# primary prompt
|
||||||
|
|
Loading…
Reference in a new issue