OH-MY-ZSH Enable Terraform workspace name in prompt
Posted on April 24, 2023
Enable Terraform workspace name in prompt in the same style as git:
$ vim .zshrc
Add the following code:
# Enable terraform workspace name in prompt
PROMPT+='$(tf_prompt_info)'
ZSH_THEME_TF_PROMPT_PREFIX="$FG[046]tf:(%{$fg[red]%}"
ZSH_THEME_TF_PROMPT_SUFFIX="$FG[046])%{$reset_color%} "
Example: