Powerlevel9k / powerlevel9k

Powerlevel9k was a tool for building a beautiful and highly functional CLI, customized for you. P9k had a substantial impact on CLI UX, and its legacy is now continued by P10k.
https://github.com/romkatv/powerlevel10k
MIT License
13.46k stars 947 forks source link

warning at startup: command not found: prompt_vcsi #1384

Closed etienne-monier closed 4 years ago

etienne-monier commented 5 years ago

I've just installed powerlevel9K with oh-my-zsh on a distant machine. Each time I open a shell or type a command, I get the following message:

build_left_prompt:12: command not found: prompt_vcsi

I use the same config on my personal laptop and this does not appear :s

Here is my config:

##
## ZSH config
##

# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"

# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="powerlevel9k/powerlevel9k"

# Uncomment the following line to use case-sensitive completion.
CASE_SENSITIVE="true"

# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS=true

# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="true"

# Uncomment the following line to display red dots whilst waiting for completion.
COMPLETION_WAITING_DOTS="true"

# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"

# To prevent warning for root_indicator
ZSH_DISABLE_COMPFIX=true

# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
  pyenv
  git
  zsh-autosuggestions
  colored-man-pages
  z
  zsh-syntax-highlighting
)

source $ZSH/oh-my-zsh.sh
source $HOME/.oh-my-zsh/plugins/z/z.sh

##
## Plugin config
##

POWERLEVEL9K_MODE="nerdfont-complete"

# OS icon segment
POWERLEVEL9K_CUSTOM_UBUNTU_ICON="echo -e '\uf31b'"
POWERLEVEL9K_CUSTOM_UBUNTU_ICON_BACKGROUND=234
POWERLEVEL9K_CUSTOM_UBUNTU_ICON_FOREGROUND=196

# SSH segment
POWERLEVEL9K_SSH_ICON='\uf68c'

# Root indicator segment
POWERLEVEL9K_ROOT_ICON="\uf198"
POWERLEVEL9K_ROOT_INDICATOR_BACKGROUND=196
POWERLEVEL9K_ROOT_INDICATOR_FOREGROUND=232

# Dir directory element
POWERLEVEL9K_DIR_HOME_BACKGROUND=39
POWERLEVEL9K_DIR_HOME_FOREGROUND=232
POWERLEVEL9K_DIR_HOME_SUBFOLDER_BACKGROUND=39
POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND=232
POWERLEVEL9K_DIR_DEFAULT_BACKGROUND=39
POWERLEVEL9K_DIR_DEFAULT_FOREGROUND=232
POWERLEVEL9K_SHORTEN_DIR_LENGTH=2
POWERLEVEL9K_SHORTEN_STRATEGY="truncate_to_first_and_last"

# Background job segment
POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=232
POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND=178

# Status bar segment
POWERLEVEL9K_STATUS_OK_BACKGROUND=232
POWERLEVEL9K_STATUS_OK_FOREGROUND=46
POWERLEVEL9K_STATUS_ERROR_BACKGROUND=232
POWERLEVEL9K_STATUS_ERROR_FOREGROUND=196

# Time segment
POWERLEVEL9K_TIME_FORMAT="%D{\ue383 %H:%M \uf073 %d.%m.%y}"
POWERLEVEL9K_TIME_FOREGROUND=232

# Multiline prompt
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX="\n\u256d\u2500 "
POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="\u2570\uf460 "

# Pyenv segment

POWERLEVEL9K_PYTHON_ICON="\ue235"
POWERLEVEL9K_VIRTUALENV_BACKGROUND=128 # 165
POWERLEVEL9K_VIRTUALENV_FOREGROUND=232

#
# Segments config

# Left segments
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
  # SSH connection
  POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_ubuntu_icon ssh context root_indicator dir vcsi virtualenv)
else
  # No SSH connection
  POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_ubuntu_icon root_indicator dir vcs virtualenv)
fi

# Right segments
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status background_jobs time)

##
## User configuration
##

# You may need to manually set your language environment
export LANG=fr_FR.UTF-8

# Color 256
export TERM='xterm-256color'

# History configuration
HISTSIZE=3000     # Nb de lignes en mémoire
HISTFILE=~/.zsh_history   # Fichier de sauvegarde
SAVEHIST=3000     # Nb d'entrées à enregistrer
HISTDUP=erase     # Suppression des doublons
setopt  appendhistory   # Ajout des entrées en mode append
setopt  sharehistory    # Partage de l'historique entre les terminaux
setopt  incappendhistory  # Ajout immédiat de l'historique (pas à la fermeture)

I should check, but I think I had this problem before (distant machine also) and I just removed one or two segments to have it work.

Thanks.

Syphdias commented 5 years ago

There's a typo: replace vcsi with vcs. sed -i 's/ vcsi / vcs /' $your_zshrc_with_p9k_syntax

PS: I suspect you use vi

etienne-monier commented 5 years ago

Ok ! That's really stupid !!!

The reality is that i used a lot of someone else's config to build mine. I found it strange to see a i at the end of vcs. I told myself that should be something in case of ssh connection. It was strange also not to see vcsi in the powerlevel9k doc. That was the reason :D

Thanks and sorry for that :s

Closed !