0
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-09-19 04:01:21 +02:00

feat(agnoster): add VRF name to prompt if available

This commit is contained in:
Pierre-Emmanuel LE THIEC 2022-08-14 23:40:16 +02:00
parent 3668ec2a82
commit 983ef7c8d1

View file

@ -241,12 +241,25 @@ prompt_aws() {
esac
}
# VRF Profile
# Display current VRF name
prompt_vrf() {
if ((${+commands[ip]} )); then
VRF=$(ip vrf identify)
[[ -z "$VRF" ]] && return
prompt_segment green black "${VRF:gs/%/%%}"
fi
}
## Main prompt
build_prompt() {
RETVAL=$?
prompt_status
prompt_virtualenv
prompt_aws
prompt_vrf
prompt_context
prompt_dir
prompt_git