288e596566
Improves the formatting of the Terraform plugin's `tf_prompt_info()` function (see #6373 and #6418). It: - adds a `tf:` prefix to indicate that what follows is the Terraform workspace - adds colorization and formatting to make the appearance more similar to the `git-prompt` plugin - adds a trailing space to separate the prompt from user input
11 lines
323 B
Bash
11 lines
323 B
Bash
function tf_prompt_info() {
|
|
RESET="%{${reset_color}%}"
|
|
|
|
# check if in terraform dir
|
|
if [ -d .terraform ]; then
|
|
workspace=$(terraform workspace show 2> /dev/null) || return
|
|
TF_INFO="$RESET%{$fg_bold[blue]%}tf:(%{$fg_bold[magenta]%}$workspace%{$fg_bold[blue]%})$RESET "
|
|
echo "$TF_INFO"
|
|
fi
|
|
}
|