Closed KumarNarendra closed 5 years ago
Please post your ~/.zshrc
.
POWERLEVEL9K_MODE="nerdfont-complete" POWERLEVEL9K_DIR_PATH_HIGHLIGHT_FOREGROUND='red' POWERLEVEL9K_DIR_PATH_HIGHLIGHT_BOLD=true
POWERLEVEL9K_DIR_SHOW_WRITABLE=true POWERLEVEL9K_PROMPT_ON_NEWLINE=true POWERLEVEL9K_PROMPT_ADD_NEWLINE=true POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon user root_indicator context dir dir_writable virtualenv anaconda pyenv vcs) POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status command_execution_time background_jobs history time java_version node_version) POWERLEVEL9K_TIME_FORMAT="%D{%H:%M:%S | %d.%m.%y}"
POWERLEVEL9K_VCS_MODIFIED_BACKGROUND='red'
local user_symbol="$" if [[ $(print -P "%#") =~ "#" ]]; then user_symbol = "#" fi
DEFAULT_USER=$USER ZSH_THEME="powerlevel9k/powerlevel9k"
Is this really the whole content of your ~/.zshrc
? My guess is that it's something else you have there that breaks your prompt. If you disable all plugins and other customizations and leave just the theme and POWERLEVEL9K
options, does it fix your prompt?
By removing everything and just using the default configurations also didn't work. But When I switched to
powerlevel10K
it seems to work fine, with one exception:
left_prompt_segment:87: bad math expression: illegal character: ^/
This occurs for the VCS segment when the branch has subfolders strategy.
This occurs for the VCS segment when the branch has subfolders strategy.
Could you post the full config that triggers this problem?
Here is the full config:
` export LANG=en_US.UTF-8 export LC_ALL=en_US.UTF-8
export PATH=$HOME/bin:/usr/local/bin:$PATH
export ZSH="/Users/narendrakumar/.oh-my-zsh"
ZSH_THEME="robbyrussell"
POWERLEVEL9K_MODE="nerdfont-complete" POWERLEVEL9K_DIR_PATH_HIGHLIGHT_FOREGROUND='cyan' POWERLEVEL9K_DIR_PATH_HIGHLIGHT_BOLD=true
POWERLEVEL9K_DIR_SHOW_WRITABLE=true POWERLEVEL9K_PROMPT_ON_NEWLINE=true POWERLEVEL9K_PROMPT_ADD_NEWLINE=true POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon user root_indicator context dir dir_writable vcs) POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status command_execution_time background_jobs history time java_version node_version) POWERLEVEL9K_TIME_FORMAT="%D{%H:%M:%S | %d.%m.%y}"
POWERLEVEL9K_VCS_MODIFIED_BACKGROUND='red'
local user_symbol="$" if [[ $(print -P "%#") =~ "#" ]]; then user_symbol = "#" fi
DEFAULT_USER=$USER
ZSH_THEME="powerlevel10k/powerlevel10k"
plugins=( archlinux autojump aws battery bgnotify boot2docker bower branch brew bwana cf cloudfoundry colored-man-pages colorize command-not-found copybuffer copydir copyfile cp dircycle dirhistory django docker docker-compose docker-machine droplr emoji emoji-clock encode64 extract fd gb git git-auto-fetch git-extras git-prompt gitignore go golang gradle grails grunt gulp helm heroku httpie iterm2 jenv jira jsontools jump kops kube-ps1 kubectl man minikube mvn ng node npm nvm osx per-directory-history perms postgres pylint python rsync sbt scala sdk spring sublime sudo swiftpm systemadmin systemd terraform themes timer tmux tmuxinator urltools virtualenv vscode wd web-search xcode yarn zsh-autosuggestions zsh-navigation-tools zsh_reload zsh-syntax-highlighting )
source $ZSH/oh-my-zsh.sh
alias
.#
source /usr/local/share/antigen/antigen.zsh
antigen bundle djui/alias-tips
antigen apply
TIMER_FORMAT='[%d]'; TIMER_PRECISION=2;
`
I took your config as the base, removed plugins that don't exist in the standard Oh-My-Zsh installation, removed plugins that complain on startup that I don't have the required software installed, and eventually got it working. I couldn't reproduce the problem.
This occurs for the VCS segment when the branch has subfolders strategy.
Could you clarify what "the branch has subfolders strategy" means? What do I need to do to trigger the problem?
P.S.
The original problem was caused by timer
plugin. You need to disable it as it's incompatible with many themes including Powerlevel10k. The good thing is that you have command_execution_time
in your Powerlevel10k config, so you don't need the functionality provided by the timer
plugin.
You also have several plugins that do literally nothing except make your prompt slow. You need to remove them. I identified these two: git-prompt
, kube-ps1
.
Another source of slowness is bgnotify
plugin. Unless you really want it, I'd recommend removing it.
After removing these plugins I've got reasonable prompt latency although it's still a bit sluggish. The number of plugins you have is quite incredible, so it's not surprising to be crippling to the performance of ZSH.
Could you clarify what "the branch has subfolders strategy" means? What do I need to do to trigger the problem?
To reproduce the issue your branch should have a name with /, something like this:
abc/kumarn/replace-the-calculated-fields
Looks like the issue got resolved. Not sure how. But removing all the suggested plugins seems to fix the issue.
Phew, I'm glad. I wasn't able to reproduce the issue by creating branch abc/kumarn/replace-the-calculated-fields
, so I started writing a fairly complex command that would help diagnose the problem on your side. It's a relief that it's no longer necessary.
By the way, the number of plugins you have enabled is really high. It's an order of magnitude more than I normally see. Most plugins in oh-my-zsh are useless to 99% of ZSH users, a fair number are harmful. It's a good idea to enable only the plugins that you actually need. If you aren't sure what a given plugin does, don't enable it. When in doubt, don't enable.
@KumarNarendra
There is another user reporting the same "bad math expression" error on the same line: https://github.com/romkatv/powerlevel10k/issues/110. Unfortunately, they also cannot reproduce this after filing the issue. I added that chunk of code just yesterday. Two users seeing the same error message on the same line of code added just a day ago is almost a certain sign of a bug. If you see this error again, please try to figure out which properties of your environment lead to it. I'd very much like to reproduce it so that I can fix it.
Glad you got it working @KumarNarendra . Thanks @romkatv for trying to fix it.
For the record, I've fixed that "bad math expression" bug when @mmariani figured out how to reproduce it and helped me to replicate the setup on my machine.
For the record, I've fixed that "bad math expression" bug when @mmariani figured out how to reproduce it and helped me to replicate the setup on my machine.
@romkatv Great news. Thanks for letting us know.
Describe Your Issue
The cursor is misplaced to left and behave weirdly on typing. Also, the right prompt display seems to be malfunctioning as the segments are shifted to left and there is blank space on the right of the prompt.
Have you tried to debug or fix it?
Nope. Not sure how to do that.
Environment Information
This information will help us understand your configuration.