zsh-users
 help / color / mirror / code / Atom feed
From: Roman Neuhauser <neuhauser@sigpipe.cz>
To: Peter Stephenson <p.w.stephenson@ntlworld.com>
Cc: zsh-users@zsh.org
Subject: Re: what does 'interactive' mean?
Date: Tue, 10 Aug 2021 15:47:58 +0200	[thread overview]
Message-ID: <YRKDjkHP7UMAcq1m@isis.sigpipe.cz> (raw)
In-Reply-To: <939622201.802587.1628597522569@mail2.virginmedia.com>

# p.w.stephenson@ntlworld.com / 2021-08-10 13:12:02 +0100:
> > On 10 August 2021 at 03:58 Roman Neuhauser <neuhauser@sigpipe.cz> wrote:
> > the description of INTERACTIVE in zshoptions(1) contains
> > *no mention of its effects*!
> > 
> >   INTERACTIVE (-i, ksh: -i)
> >     This is an interactive shell.  This option is set upon
> >     initialisation if the standard input is a tty and commands are
> >     being read from standard input.  (See the discussion of
> >     SHIN_STDIN.) This heuristic may be overridden by specifying a
> >     state for this option on the command line.  The value of this
> >     option can only be changed via flags supplied at invocation of
> >     the shell.  It cannot be changed once zsh is running.
> 
> As you say, the documentation is confusing.  What it's trying to say,
> but not making a good job of, is that basically the conditions
> here (tty on STDIN with commands coming from it, which cause the
> INTERACTIVE option to be set) define an interactive shell

you're on the right track here.  one thing i tried to convey was
that the manual overloads the meaning of "interactive shell"
(the colloquial use in the blurb vs. the should-be-precise technical
one basically everywhere else), and that "interactive shell" is too
entrenched as an informal coin to be useful in a technical reference,
that ship has sailed.

with that in mind, i don't think the proposed definition is useful,
or rather, the conditions should be called something other than
"interactive shell" because that is usually understood to include
some kind of online editing facility a la ZLE.  you could strip
zsh down so much its interactive mode would behave like '>>(zsh)'
and it would still fit the definition you offered here.
nobody would accept that as an "interactive login shell".

i think we already have a name for that set of conditions, it's
called "the INTERACTIVE option is set"!

> The shell tests the option internally in a great number of places
> to see if it's appropriate to output prompts, use the line editor,
> etc. etc.  Mostly this is mentioned in the manual, but only
> with something like "if the shell is interactive..."
> This becomes more useful if you know it's testing the
> option when that happens, so somewhere we need a sentence along
> the lines of "where the shell needs to decide if it is
> interactive at run time, it tests the state of the INTERACTIVE shell
> option.  See XXXX for information on this".

i disagree, this is an unnecessary indirection.  i propose

  s/if the shell is interactive/if the INTERACTIVE option is set/g

it's longer by a negligible margin and needs no further cross-reference.

aaand then there's the smaller fish i mentioned, like the text about
the ZLE option being misleading at the very least.  i'll get back to
you later about that.

while i love back-seat driving this is not meant that way.
i'd like to have a patch for this ready by the weekend and then
continue with other parts of the manual that in my opinion don't work
as well as they should and could.  there'll be no ambushes though,
you can always expect a rant first so we can discuss the issue and
see where we meet.

-- 
roman


  reply	other threads:[~2021-08-10 13:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-10  2:58 Roman Neuhauser
2021-08-10  9:04 ` Thomas Paulsen
2021-08-10 13:00   ` Roman Neuhauser
2021-08-10 12:12 ` Peter Stephenson
2021-08-10 13:47   ` Roman Neuhauser [this message]
2021-08-10 13:54     ` Peter Stephenson
2021-08-10 15:30   ` Ray Andrews
2021-08-10 16:34     ` Peter Stephenson
2021-08-10 16:48       ` Ray Andrews
2021-08-10 19:00         ` Bart Schaefer
2021-08-10 22:33           ` Ray Andrews
2021-08-10 19:30         ` Lawrence Velázquez
2021-08-10 22:38           ` Ray Andrews
2021-08-10 23:08             ` Bart Schaefer
2021-08-10 23:26               ` Ray Andrews
2021-08-10 23:30                 ` Bart Schaefer

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=YRKDjkHP7UMAcq1m@isis.sigpipe.cz \
    --to=neuhauser@sigpipe.cz \
    --cc=p.w.stephenson@ntlworld.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).