mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-11 00:00:06 +00:00
Nodeenv work
This commit is contained in:
parent
d5ac1735da
commit
e0603314d5
1 changed files with 17 additions and 0 deletions
|
@ -556,6 +556,23 @@ prompt_nvm() {
|
||||||
|
|
||||||
$1_prompt_segment "$0" "$2" "green" "011" "${node_version:1}" 'NODE_ICON'
|
$1_prompt_segment "$0" "$2" "green" "011" "${node_version:1}" 'NODE_ICON'
|
||||||
}
|
}
|
||||||
|
# NodeEnv Prompt
|
||||||
|
prompt_nodeenv(){
|
||||||
|
export NODE_VIRTUAL_ENV_DISABLE_PROMPT=1
|
||||||
|
ZSH_THEME_NODEENV_PROMPT_PREFIX="("
|
||||||
|
ZSH_THEME_NODEENV_PROMPT_SUFFIX=")"
|
||||||
|
if [ -n "$NODE_VIRTUAL_ENV" ]; then
|
||||||
|
|
||||||
|
if [ "`basename "$NODE_VIRTUAL_ENV"`" = "__" ] ; then
|
||||||
|
# special case for Aspen magic directories
|
||||||
|
# see http://www.zetadev.com/software/aspen/
|
||||||
|
local name="[`basename \`dirname "$NODE_VIRTUAL_ENV"\``]"
|
||||||
|
else
|
||||||
|
local name=`basename "$NODE_VIRTUAL_ENV"`
|
||||||
|
fi
|
||||||
|
echo "$ZSH_THEME_NODEENV_PROMPT_PREFIX$name$ZSH_THEME_NODEENV_PROMPT_SUFFIX"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# print a little OS icon
|
# print a little OS icon
|
||||||
prompt_os_icon() {
|
prompt_os_icon() {
|
||||||
|
|
Loading…
Reference in a new issue