IntelliJ looks run $ZDOTDIR./.zshrc and $ZDOTDIR./.zlogin twice

Answered

I use IntelliJ IDEA integrated terminal.

When $ZDOTDIR is set as Environment value, zsh in integrated terminal invokes config files as below order.

  1. ~/.zsh/.zshrc
  2. ~/.zsh/.zprofile
  3. ~/.zsh/.zshrc
  4. ~/.zsh/.zlogin
  5. ~/.zsh/.zlogin

On the other hand, When $ZDOTDIR is set in .zshenv, invoke as below order.

  1. ~/.zshenv (here I set $ZDOTDIR=~/.zsh)
  2. ~/.zprofile
  3. ~/.zshrc
  4. ~/.zlogin

Both cases have problems. The first case zsh invokes .zshrc and .zlogin twice. In the second case zsh invokes HOME/.zshrc in spite of $ZDOTDIR is set in .zshenv.

How do my zsh invoke ~/.zsh/.zshrc only once?

0

Please sign in to leave a comment.