mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-25 05:41:58 +00:00
mend
This commit is contained in:
parent
7e9fa1a5f8
commit
80d1f26501
1 changed files with 4 additions and 3 deletions
|
@ -6,11 +6,12 @@
|
|||
# dashed separator size
|
||||
function afmagic_dashes {
|
||||
# check either virtualenv or condaenv variables
|
||||
local python_env_dir="${VIRTUAL_ENV:-$CONDA_DEFAULT_ENV}"
|
||||
local python_env="${python_env_dir##*/}"
|
||||
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 ))
|
||||
else
|
||||
echo $COLUMNS
|
||||
|
|
Loading…
Reference in a new issue