From: TJ Luoma <luomat@gmail.com>
To: Zsh-Users List <zsh-users@zsh.org>
Subject: 'login' vs 'interactive' ?
Date: Tue, 18 Nov 2014 11:11:46 -0500 [thread overview]
Message-ID: <CADjGqHvbH0nM7BtNnN27Vbpi840TKA0aXhzCBKL5eNAe+DM2Mg@mail.gmail.com> (raw)
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.
next reply other threads:[~2014-11-18 16:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-18 16:11 TJ Luoma [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CADjGqHvbH0nM7BtNnN27Vbpi840TKA0aXhzCBKL5eNAe+DM2Mg@mail.gmail.com \
--to=luomat@gmail.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).