ZSH config file is really heavy
See original GitHub issueHi,
I tried to source $(pew shell_config)
in my .zshrc
to have a feedback on the venv I am using, in my prompt. However, it adds 2 extra seconds or so to spawn a new ZSH shell, which is a lot for such a basic feature.
Is it normal? Expected?
Thanks
EDIT: Plus it messes with my PS1, breaking new lines etc.
Issue Analytics
- State:
- Created 8 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
oh-my-zsh config file not loading - Stack Overflow
I figured this out. It was due to my config file. The part of the zsh config that wasn't loading needed to be...
Read more >Create a secure configuration file for zsh scripts
Is that a config file for the shell session in general (like .zshrc and such), or for some other tool you provide? I.e....
Read more >zsh starts incredibly slowly - Super User
My ~/.zsh_history measured 1.8MB. Its very possible to accidentally paste a large chunk of stuff as a command into a terminal, this will...
Read more >Speeding up zsh and Oh-My-Zsh - JonLuca's Blog
This can be slightly fixed with git config oh-my-zsh.hide-status 1 on problematic repos, but it would be nice if it did so automatically....
Read more >Better zsh history - SoberKoder
By saving history to a file, and by letting the file grow very large, more commands can be retained and be available for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ashwinvis There are two ways to speed up a shell start using pew.
If you’re using a framework like Oh My Zsh or Prezto that loads compinit, you can see a large speedup by deleting compinit from line 2 of PEW’s init.zsh file. For example, mine is located at “/usr/local/lib/python3.6/site-packages/pew/shell_config/init.zsh” As long as pew is sourced after the framework (at the end of .zshrc in my case) this will result in a speedup of roughly 0.7 seconds without losing completion. Loading completion is one of the biggest slowdowns with shell startup.
If you use the python2 package for pew, shell start-up is about 0.2 seconds faster, presumably because python 2 still starts up faster than python 3 (even 3.7 by ~2 fold)
Let me know if you have any test in mind that I could do to debug it further.
Here is a quick comparison on another laptop, same issue:
Without the
source
line:With the
source
line: