Compare commits

...

3 Commits

Author SHA1 Message Date
Pedro A. Aranda Gutiérrez fbac8adcd1
Merge 0047214255 into 1c34b0e67d 2025-01-30 17:14:12 +02:00
soemiran 1c34b0e67d
feat(terraform): support `TF_DATA_DIR` in `tf_prompt_info` (#12949) 2025-01-30 16:14:04 +01:00
Pedro A. Aranda Gutiérrez 0047214255
Allow user to define CURRENT_FG for agnoster.zsh-theme
Some terminal themes make CURRENT_FG black/white selection sub-optimal. Allow user to define CURRENT_FG for best legibility in the directory part.
2025-01-09 18:15:12 +01:00
2 changed files with 5 additions and 4 deletions

View File

@ -2,9 +2,9 @@ function tf_prompt_info() {
# dont show 'default' workspace in home dir # dont show 'default' workspace in home dir
[[ "$PWD" != ~ ]] || return [[ "$PWD" != ~ ]] || return
# check if in terraform dir and file exists # check if in terraform dir and file exists
[[ -d .terraform && -r .terraform/environment ]] || return [[ -d "${TF_DATA_DIR:-.terraform}" && -r "${TF_DATA_DIR:-.terraform}/environment" ]] || return
local workspace="$(< .terraform/environment)" local workspace="$(< "${TF_DATA_DIR:-.terraform}/environment")"
echo "${ZSH_THEME_TF_PROMPT_PREFIX-[}${workspace:gs/%/%%}${ZSH_THEME_TF_PROMPT_SUFFIX-]}" echo "${ZSH_THEME_TF_PROMPT_PREFIX-[}${workspace:gs/%/%%}${ZSH_THEME_TF_PROMPT_SUFFIX-]}"
} }

View File

@ -34,9 +34,10 @@
CURRENT_BG='NONE' CURRENT_BG='NONE'
# Set CURRENT_FG unless already set in .zshenv
case ${SOLARIZED_THEME:-dark} in case ${SOLARIZED_THEME:-dark} in
light) CURRENT_FG='white';; light) CURRENT_FG=${CURRENT_FG:-white};;
*) CURRENT_FG='black';; *) CURRENT_FG=${CURRENT_FG:-black};;
esac esac
# Special Powerline characters # Special Powerline characters