Skip to content

Commit 7ff8361

Browse files
authored
fix(gcloud): prevent gcloud CLI from hanging (romkatv#2935)
If the `gcloud` command is interactive (e.g. asks to install a component, or needs an update), the current code will hang forever, and is uninterruptible as `INT` is being swallowed. Fix this with `</dev/null` and `--quiet`.
1 parent 8ed1f58 commit 7ff8361

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

internal/p10k.zsh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4716,7 +4716,9 @@ _p9k_gcloud_prefetch() {
47164716
if ! _p9k_cache_stat_get $0 ${CLOUDSDK_CONFIG:-~/.config/gcloud}/configurations/config_$P9K_GCLOUD_CONFIGURATION; then
47174717
local pair account project_id
47184718
pair="$(gcloud config configurations describe $P9K_GCLOUD_CONFIGURATION \
4719-
--format=$'value[separator="\1"](properties.core.account,properties.core.project)')"
4719+
--quiet \
4720+
--format=$'value[separator="\1"](properties.core.account,properties.core.project)' \
4721+
</dev/null)"
47204722
(( ! $? )) && IFS=$'\1' read account project_id <<<$pair
47214723
_p9k_cache_stat_set "$account" "$project_id"
47224724
fi

0 commit comments

Comments
 (0)