aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-05-21 15:14:04 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-05-21 15:14:04 +0300
commitf27db9233521ccfa6c41be5570ab3f62fa1deabc (patch)
treec4d896f62054f16284ce7adeb50dc6cab116d509 /powerlevel9k.zsh-theme
parentfed768479f8fedb28766927d914b007983d71a04 (diff)
speed up nodeenv prompt
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme3
1 files changed, 2 insertions, 1 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 17c780e3..9d957285 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -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
}