From 2eab8618b7fd985aff6a7d50ccef6554a7f68d8a Mon Sep 17 00:00:00 2001 From: lcorsini Date: Mon, 19 Oct 2020 23:15:50 +0200 Subject: [PATCH] added tfenv support --- internal/p10k.zsh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 1626c59f..f38045cc 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4289,6 +4289,17 @@ _p9k_prompt_swift_version_init() { typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$commands[swift]' } +################################################################ +# Segment to display terraform version in use with tfenv +prompt_tfenv() { + local tfenv_use_version="$(tfenv list | grep '\*' | awk '{print $2}')" + _p9k_prompt_segment "$0" "white" "blue" "TERRAFORM_ICON" 0 '' "${tfenv_use_version//\%/%%}" +} + + +_p9k_prompt_tfenv_init() { + typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$commands[tfenv]' +} ################################################################ # dir_writable: Display information about the user's permission to write in the current directory prompt_dir_writable() {