Slightly patched oh-my-zsh tree
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

18 lines
711 B

function vagrant_prompt_info() {
if [[ ! -d .vagrant || ! -f Vagrantfile ]]; then
return
fi
local vm_states vm_state
vm_states=(${(f)"$(vagrant status 2> /dev/null | sed -nE 's/^[^ ]* *([[:alnum:] ]*) \([[:alnum:]_]+\)$/\1/p')"})
printf '%s' $ZSH_THEME_VAGRANT_PROMPT_PREFIX
for vm_state in $vm_states; do
case "$vm_state" in
running) printf '%s' $ZSH_THEME_VAGRANT_PROMPT_RUNNING ;;
"not running"|poweroff) printf '%s' $ZSH_THEME_VAGRANT_PROMPT_POWEROFF ;;
paused|saved|suspended) printf '%s' $ZSH_THEME_VAGRANT_PROMPT_SUSPENDED ;;
"not created") printf '%s' $ZSH_THEME_VAGRANT_PROMPT_NOT_CREATED ;;
esac
done
printf '%s' $ZSH_THEME_VAGRANT_PROMPT_SUFFIX
}