Compare commits

...

4 Commits

Author SHA1 Message Date
Hoàng Minh Hưởng eb0569c11f
Merge b0b98ed439 into 7ff836131a 2026-03-11 10:16:39 +09:00
Kevin Ji 7ff836131a
fix(gcloud): prevent gcloud CLI from hanging (#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`.
2026-03-11 09:09:44 +08:00
Hoang Minh Huong b0b98ed439 fix(prompt_dir): converting drive letters to uppercase 2025-10-28 23:11:06 +07:00
Hoang Minh Huong fb5bcf70fd fix(prompt_dir): adjust path formatting for Windows compatibility 2025-10-28 22:50:51 +07:00
1 changed files with 9 additions and 2 deletions

View File

@ -2131,7 +2131,12 @@ prompt_dir() {
local content="${(pj.$sep.)parts}" local content="${(pj.$sep.)parts}"
if (( _POWERLEVEL9K_DIR_HYPERLINK && _p9k_term_has_href )) && [[ $_p9k__cwd == /* ]]; then if (( _POWERLEVEL9K_DIR_HYPERLINK && _p9k_term_has_href )) && [[ $_p9k__cwd == /* ]]; then
_p9k_url_escape $_p9k__cwd local cur_path=$_p9k__cwd
if [[ $_p9k_os == Windows && $cur_path != *:* ]]; then
# Change /c/current/path to /c:/current/path
cur_path="${_p9k__cwd:0:2:u}:${_p9k__cwd:2}"
fi
_p9k_url_escape $cur_path
local header=$'%{\e]8;;file://'$_p9k__ret$'\a%}' local header=$'%{\e]8;;file://'$_p9k__ret$'\a%}'
local footer=$'%{\e]8;;\a%}' local footer=$'%{\e]8;;\a%}'
if (( expand )); then if (( expand )); then
@ -4716,7 +4721,9 @@ _p9k_gcloud_prefetch() {
if ! _p9k_cache_stat_get $0 ${CLOUDSDK_CONFIG:-~/.config/gcloud}/configurations/config_$P9K_GCLOUD_CONFIGURATION; then if ! _p9k_cache_stat_get $0 ${CLOUDSDK_CONFIG:-~/.config/gcloud}/configurations/config_$P9K_GCLOUD_CONFIGURATION; then
local pair account project_id local pair account project_id
pair="$(gcloud config configurations describe $P9K_GCLOUD_CONFIGURATION \ pair="$(gcloud config configurations describe $P9K_GCLOUD_CONFIGURATION \
--format=$'value[separator="\1"](properties.core.account,properties.core.project)')" --quiet \
--format=$'value[separator="\1"](properties.core.account,properties.core.project)' \
</dev/null)"
(( ! $? )) && IFS=$'\1' read account project_id <<<$pair (( ! $? )) && IFS=$'\1' read account project_id <<<$pair
_p9k_cache_stat_set "$account" "$project_id" _p9k_cache_stat_set "$account" "$project_id"
fi fi