Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

'login' vs 'interactive' ?



1) Can someone explain the difference between 'login' and
'interactive' in these two examples:

if [[ -o login ]]; then
  echo "I'm a login shell"
fi

if [[ -o interactive ]]; then
  echo "I'm interactive"
fi


2) is 'login' vs 'interactive' similar to "every square is a rectangle
but a rectangle is not necessarily a square"?

As in "Every login shell is interactive, but an interactive shell is
not necessarily a login shell"?


3) Imagine an alternate universe where zsh _automatically_ reads
~/.zshenv but NOT ~/.zshrc so you had to tell zsh to read ~/.zshrc as
part of ~/.zshenv.

Would the answer be:

if [[ -o login ]]; then
  source .zshrc
fi

or

if [[ -o interactive ]]; then
  source .zshrc
fi

or does it matter?


4) Anything else I should understand about these two?

Thanks!

TjL


ps - I swear I knew the answer to this at one time, but I can't
remember it, nor has Google helped me find the answer.



Messages sorted by: Reverse Date, Date, Thread, Author