zsh-users
 help / color / mirror / code / Atom feed
* 'login' vs 'interactive' ?
@ 2014-11-18 16:11 TJ Luoma
  2014-11-18 16:21 ` Axel Beckert
  2014-11-18 16:39 ` Peter Stephenson
  0 siblings, 2 replies; 7+ messages in thread
From: TJ Luoma @ 2014-11-18 16:11 UTC (permalink / raw)
  To: Zsh-Users List

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.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-11-18 19:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-18 16:11 'login' vs 'interactive' ? TJ Luoma
2014-11-18 16:21 ` Axel Beckert
2014-11-18 17:19   ` Ray Andrews
2014-11-18 19:27     ` Axel Beckert
2014-11-18 16:39 ` Peter Stephenson
2014-11-18 16:57   ` René Neumann
2014-11-18 17:06     ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).