From 983ef7c8d14752e1d0acddea73fb4d51db88fb58 Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel LE THIEC Date: Sun, 14 Aug 2022 23:40:16 +0200 Subject: [PATCH] feat(agnoster): add VRF name to prompt if available --- themes/agnoster.zsh-theme | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 5f4efe813..ccbafd8ef 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -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