> > I'm not sure what to say about that; is it possible that $HOME is set > incorrectly or that $ZDOTDIR is set? This was my problem ... I had completely forgotten about $ZDOTDIR. I just found out that in one case the shell was running ~/.zshrc and in the other case $ZDOTDIR/.zshrc I managed to fix that issue by letting one of those files source the other. > You have misunderstood how the shell options work. Yes ... I mistakenly thought that --rcs worked the same way as --rcfile in bash Thank you for your help! On Wed, Feb 20, 2019 at 5:11 AM Bart Schaefer wrote: > On Tue, Feb 19, 2019, 3:05 PM Guðmundur Páll Kjartansson wrote: > >> Greetings >> >> I have some strange buggy behaviour going on. If I run zsh in a bash >> terminal window, it will not run .zshrc: >> >> $ zsh >> > > I'm not sure what to say about that; is it possible that $HOME is set > incorrectly or that $ZDOTDIR is set? Does zsh appear otherwise to be > interactive, i.e., it prints prompts and ZLE is working? > > If I instead do this: >> >> $ zsh --rcs ~/.zshrc >> >> Then it will run .zshrc ... but it will also exit immediately > > > You have misunderstood how the shell options work. If you give the shell > a file name as an argument, it reads that file for commands and then > exits. The --rcs option does not change that, it merely says that it's OK > for the shell to read the usual startup files as well (where "usual" > depends on whether the shell is interactive, is a login shell, etc.). > > --rcs is the default, so ordinarily one would be using --norcs to turn > them off instead. > > ... this >> happens even if I run it in interactive mode: >> >> $ zsh --interactive ~/.zshrc >> > > Yes, even if the shell is interactive a filename argument means to read > the file and exit. > > To force the shell NOT to read commands from the argument file, you must > use the --shinstdin option. There is no simple way to cause the shell to > first read a file and then continue reading from stdin / the terminal. >