2

I'm currently using zsh as my shell on my Windows machines running WSL. Everything seems to be working fine, but one thing that keeps bugging me is the loading time on each shell startup.

On each startup of Bash, zsh gets executed from the .bashrc file. I'm pretty new to working on the command line and haven't really taken times, but echoed out messages in different parts of my .bashrc and .zshrc files. What seems to be the main culprits are the .bashrc file initialization itself and the loading of zcompdump-file in the .zshrc file.

Questions

  1. By using zsh in WSL, can I clear out my .bashrc file and possibly other bash config files to make zsh faster on startup?

  2. Can I remove the lines:

    typeset -i updated_at=$(date +'%j' -r ~/.zcompdump 2>/dev/null || stat -f '%Sm' -t '%j' ~/.zcompdump 2>/dev/null)
    
    if [ $(date +'%j') != $updated_at ]; then
       compinit -i
    else
       compinit -C -i
    fi
    

    or are they useful for the zsh-completions?

1
  1. I just solved this for myself by creating a shortcut to "C:\Windows\System32\bash.exe -c /usr/bin/zsh".
  2. It is useful.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.