Merge branch 'master' of https://github.com/ohmyzsh/ohmyzsh into add-stash-info

This commit is contained in:
Jacob Olson 2025-02-21 15:41:14 -07:00
commit c339e474a1
518 changed files with 15246 additions and 8015 deletions

View file

@ -6,12 +6,15 @@
# dashed separator size
function afmagic_dashes {
# check either virtualenv or condaenv variables
local python_env="${VIRTUAL_ENV:-$CONDA_DEFAULT_ENV}"
local python_env_dir="${VIRTUAL_ENV:-$CONDA_DEFAULT_ENV}"
local python_env="${python_env_dir##*/}"
# if there is a python virtual environment and it is displayed in
# the prompt, account for it when returning the number of dashes
if [[ -n "$python_env" && "$PS1" = \(* ]]; then
if [[ -n "$python_env" && "$PS1" = *\(${python_env}\)* ]]; then
echo $(( COLUMNS - ${#python_env} - 3 ))
elif [[ -n "$VIRTUAL_ENV_PROMPT" && "$PS1" = *${VIRTUAL_ENV_PROMPT}* ]]; then
echo $(( COLUMNS - ${#VIRTUAL_ENV_PROMPT} ))
else
echo $COLUMNS
fi