aboutsummaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'internal/p10k.zsh')
-rw-r--r--internal/p10k.zsh6
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 1e611ee8..6dc38561 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -2425,10 +2425,13 @@ instant_prompt_os_icon() { prompt_os_icon; }
################################################################
# Segment to display PHP version number
prompt_php_version() {
+ if (( _POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY )); then
+ _p9k_upglob 'composer.json|*.php' && return
+ fi
_p9k_cached_cmd_stdout php --version || return
[[ $_p9k__ret == (#b)(*$'\n')#(PHP [[:digit:].]##)* ]] || return
local v=$match[2]
- _p9k_prompt_segment "$0" "fuchsia" "grey93" '' 0 '' "${v//\%/%%}"
+ _p9k_prompt_segment "$0" "fuchsia" "grey93" 'PHP_ICON' 0 '' "${v//\%/%%}"
}
_p9k_prompt_php_version_init() {
@@ -6331,6 +6334,7 @@ _p9k_init_params() {
esac
_p9k_declare -b POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW 0
_p9k_declare -b POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY 0
+ _p9k_declare -b POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY 0
_p9k_declare -b POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY 1
_p9k_declare -b POWERLEVEL9K_GO_VERSION_PROJECT_ONLY 1
_p9k_declare -b POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY 1