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.47k stars 947 forks source link

Terminal printing lots of "Operation not permitted" errors regarding certain directories. #1134

Closed Nobody912 closed 5 years ago

Nobody912 commented 5 years ago

Describe Your Issue

Terminal Prints:

warning: could not open directory 'Library/[Insert Directories]': Operation not permitted

See it in action:

Have you tried to debug or fix it?

Reinstalled ZSH, Oh-My-ZSH, and PowerLevel9k multiple times. Not sure of what caused the error, I'm relatively new to all of this.

Environment Information

OS: macOS 10.14.2 (18C54) System: MacBook Pro (Retina, 13-inch, Early 2015) ZSH Version: zsh 5.6.2 (x86_64-apple-darwin18.2.0) ZSH Framework: Oh-My-ZSH Installation Method: Repo P9K Version: Release v0.6.6 (Not sure, probably latest) Terminal Emulator: iTerm2

dritter commented 5 years ago

Hi @Nobody912 ,

could you give us some more informations about your setup? I can see your home folder is a git checkout. Can you show us your dotfiles? Can What is the output of echo $GIT_DIR? Can you post your ~/.zshrc here?

Nobody912 commented 5 years ago

echo $GIT_DIR

echo $GIT_DIR only indents a line.

Dotfiles

https://imgur.com/a/r7HRxB2

~/.zshrc

https://pastebin.com/jAPJu37x

dritter commented 5 years ago

Okay. GIT_DIR is not set. But it is still a Git Checkout. My best guess is that you have some symlinks lying around in your Library Folder. That symlinks seem to point somewhere you don't have access to. Could you try to put the Library Folder in your .gitignore?

88maomao commented 5 years ago

Okay. GIT_DIR is not set. But it is still a Git Checkout. My best guess is that you have some symlinks lying around in your Library Folder. That symlinks seem to point somewhere you don't have access to. Could you try to put the Library Folder in your .gitignore?

I have similar issue: a folder with no user access inside a git repo. Putting the folder to .gitignore helps, but shouldn't it be caught on the plugin side?

Nobody912 commented 5 years ago

Tried and put Library in the .gitignore. This fxed the issue, but now the terminal load time is ungodly long. I have some debugging work to do.

dritter commented 5 years ago

@88maomao Well. Maybe. I would ask why there is a file/folder you don't have access to in your repo.

@Nobody912 You could have a look at our measurings we did. Basically, you could check the commands that are executed in the vcs segment, and see if they are slow itself. A shot in the dark: Probably that is related to a lot of untracked files (that's what I would guess if my Home-dir would be a repo). In general, having large repos is usually a bad idea, because there is a lot of overhead (git tracking files, P9K trying to extract the status from git, etc.).

88maomao commented 5 years ago

@dritter And I would answer: during testing anything can happen. In my case it was 'docker run -i -t --rm -v $(pwd)/db:/var/lib/posgresql/data postgresql' inside projects folder.

Btw. about slow performance on a large repo https://github.com/robbyrussell/oh-my-zsh/issues/3009#issuecomment-420763151. Having such a latch improves karma.

dritter commented 5 years ago

@88maomao Good answer! I just merged your PR!