3

I want to run Zsh without loading any of my .zshrc, Oh-my-zsh, and so on, just like if I had a fresh install without anything customized. (Like emacs -q.)

Are there any flags for this? Otherwise, can I set up some kind of "profile" for it?

phipsgabler
  • 20,535
  • 4
  • 40
  • 60
  • I always use `ZDOTDIR` for this (as rcwnd_cz pointed out in his answer), but be aware that this does not disable configurations you might have done in `/etc`. – user1934428 May 14 '20 at 10:34

1 Answers1

7

Quoting from zsh manpages:

Commands are first read from /etc/zshenv; this cannot be overridden. Subsequent behaviour is modified by the RCS and GLOBAL_RCS options; the former affects all startup files, while the second only affects global startup files (those shown here with an path starting with a /). If one of the options is unset at any point, any subsequent startup file(s) of the corresponding type will not be read. It is also possible for a file in $ZDOTDIR to re-enable GLOBAL_RCS. Both RCS and GLOBAL_RCS are set by default.

[1] http://zsh.sourceforge.net/Doc/Release/Files.html

I guess you just want to disable your config files, so you should unset RCS option. This can be done either by running zsh -o NO_RCS or zsh -f / zsh --no-rcs.

rcwnd_cz
  • 909
  • 6
  • 18
  • 2
    You might also want `-d` to disable global rc files, so `zsh -df` – okapi May 15 '20 at 20:24
  • 1
    If I run `zsh -df` it starts zsh without all my plugins and customizations, but it still starts in Vi mode. Does this mean it still reads config from somewhere? Surely Zsh doesn't start in Vi mode by default? – Hubro Mar 02 '21 at 13:01
  • @Hubro - that may be due to the `EDITOR` environment variable. Try `env -i zsh -df`. – Gairfowl Aug 24 '23 at 12:41