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

Re: [[ -o interactive ]] vs if [[ -o login ]]?



On 15 August 2011 00:46, TJ Luoma <luomat@xxxxxxxxx> wrote:
> If there any reason to prefer
>
> if [[ -o interactive ]]
>
> rather than
>
>  if [[ -o login ]]
>
> ?
>
> Are they two ways of saying the same thing? If not, could someone
> explain the difference?

login is only set for login shells, interactive is set for all
interactive shells. I suspect that doesn't help you a lot though since
that part's pretty obvious ;). A login shell is something that is
started at the beginning of some sort of session, like logging in to X
or the console, and it will be started like $SHELL -l or -$SHELL (with
a - prepended to argv[0]). Any time you just open a terminal or run
"zsh" it is likely not a login shell, unless you configure your
terminal emulator to always start a login shell.

-- 
Mikael Magnusson



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