1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-16 01:50:06 +00:00

speed up nodeenv prompt

This commit is contained in:
romkatv 2019-05-21 14:14:04 +02:00
parent fed768479f
commit f27db92335

View file

@ -1277,7 +1277,8 @@ prompt_nvm() {
# Segment to display NodeEnv
prompt_nodeenv() {
if [[ -n "$NODE_VIRTUAL_ENV" ]]; then
local info="$(node -v)[${NODE_VIRTUAL_ENV:t}]"
_p9k_cached_cmd_stdout node --version || return
local info="${_P9K_RETVAL}[${NODE_VIRTUAL_ENV:t}]"
"$1_prompt_segment" "$0" "$2" "black" "green" 'NODE_ICON' 0 '' "${info//\%/%%}"
fi
}