aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Perepelitsa <roman.perepelitsa@gmail.com>2021-07-17 11:13:48 +0300
committerRoman Perepelitsa <roman.perepelitsa@gmail.com>2021-07-17 11:13:48 +0300
commit942c4cf640866d9655d00a2895548acee3ebf64a (patch)
tree6d7f7dcbac927cd6451428df1843a7da18058996
parent1e7be00e04a6e34bdcc7574297413fd6a48be51f (diff)
parentdae5f7f1c9ef5116b046f1f9b31a9bdf2154e76b (diff)
Merge branch 'alexganwd-master'
-rw-r--r--config/p10k-classic.zsh4
-rw-r--r--config/p10k-lean-8colors.zsh1
-rw-r--r--config/p10k-lean.zsh1
-rw-r--r--config/p10k-rainbow.zsh4
-rw-r--r--internal/p10k.zsh11
5 files changed, 21 insertions, 0 deletions
diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh
index 19c602bc..0407c354 100644
--- a/config/p10k-classic.zsh
+++ b/config/p10k-classic.zsh
@@ -70,6 +70,7 @@
haskell_stack # haskell version from stack (https://haskellstack.org/)
kubecontext # current kubernetes context (https://kubernetes.io/)
terraform # terraform workspace (https://www.terraform.io)
+ terraform_version # It shows current active terraform version
aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html)
aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/)
azure # azure account name (https://docs.microsoft.com/en-us/cli/azure)
@@ -1204,6 +1205,9 @@
typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=38
# typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐'
+ ################[ terraform_version: It shows active terraform version (https://www.terraform.io) ]#################
+ typeset -g POWERLEVEL9K_TERRAFORM_VERSION_SHOW_ON_COMMAND='terraform|tf'
+
#############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]#############
# Show kubecontext only when the the command you are typing invokes one of these tools.
# Tip: Remove the next line to always show kubecontext.
diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh
index 9d0ab9a1..93a454d2 100644
--- a/config/p10k-lean-8colors.zsh
+++ b/config/p10k-lean-8colors.zsh
@@ -70,6 +70,7 @@
haskell_stack # haskell version from stack (https://haskellstack.org/)
kubecontext # current kubernetes context (https://kubernetes.io/)
terraform # terraform workspace (https://www.terraform.io)
+ terraform_version # It shows current active terraform version
aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html)
aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/)
azure # azure account name (https://docs.microsoft.com/en-us/cli/azure)
diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh
index 9d9dcf75..f6e48806 100644
--- a/config/p10k-lean.zsh
+++ b/config/p10k-lean.zsh
@@ -70,6 +70,7 @@
haskell_stack # haskell version from stack (https://haskellstack.org/)
kubecontext # current kubernetes context (https://kubernetes.io/)
terraform # terraform workspace (https://www.terraform.io)
+ terraform_version # It shows current active terraform version
aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html)
aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/)
azure # azure account name (https://docs.microsoft.com/en-us/cli/azure)
diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh
index 42b69929..f0d800bd 100644
--- a/config/p10k-rainbow.zsh
+++ b/config/p10k-rainbow.zsh
@@ -70,6 +70,7 @@
haskell_stack # haskell version from stack (https://haskellstack.org/)
kubecontext # current kubernetes context (https://kubernetes.io/)
terraform # terraform workspace (https://www.terraform.io)
+ terraform_version # It shows current active terraform version
aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html)
aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/)
azure # azure account name (https://docs.microsoft.com/en-us/cli/azure)
@@ -1271,6 +1272,9 @@
typeset -g POWERLEVEL9K_TERRAFORM_OTHER_BACKGROUND=0
# typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐'
+ ################[ terraform_version: It shows active terraform version (https://www.terraform.io) ]#################
+ typeset -g POWERLEVEL9K_TERRAFORM_VERSION_SHOW_ON_COMMAND='terraform|tf'
+
#############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]#############
# Show kubecontext only when the the command you are typing invokes one of these tools.
# Tip: Remove the next line to always show kubecontext.
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 935a86d9..510bf3c5 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -4887,6 +4887,17 @@ _p9k_prompt_terraform_init() {
typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$commands[terraform]'
}
+function prompt_terraform_version() {
+ _p9k_cached_cmd 0 '' terraform --version
+ [[ $_p9k__ret == (#b)Terraform\ v([[:digit:].]##)* ]]
+ local terraform_version=$match[1]
+ _p9k_prompt_segment "$0$state" $_p9k_color1 red TERRAFORM_ICON 0 '' "tf:$terraform_version"
+}
+
+_p9k_prompt_terraform_version_init() {
+ typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$commands[terraform]'
+}
+
function prompt_proxy() {
local -U p=(
$all_proxy $http_proxy $https_proxy $ftp_proxy