Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: what does 'interactive' mean?
On Tue, Aug 10, 2021, at 12:48 PM, Ray Andrews wrote:
> On 2021-08-10 9:34 a.m., Peter Stephenson wrote:
> >
> > Very very very very very roughly, "interactive" in this sense means it's
> > showing you prompts and bringing up a line editor to edit the command line.
> >
> Well that's the thing. Thomas can be forgiven for being a bit unclear
> about what it all means. The docs basically assume you already know.
> But that's very roughly how I understand it -- no prompts if not
> interactive.
> > Being "non-interactive" doesn't mean you can't interact with the shell.
> > There's still probably a standard input and output.
> Just when I thought I understood it :-( So 'non-interactive' might be
> interactive after all? It would take some writing skill to really
> elucidate this.
While I empathize with the desire to concisely define terms like
"interactive shell", I've always found that approach unhelpful,
both practically and pedagogically. Same with "login shell". In
a very real sense, a shell is an interactive shell and/or a login
shell if it thinks it is. The important things are how the shell
comes to think that and how it consequently changes its behavior.
The former is described in zshoptions(1) and a little in zsh(1).
The latter is distributed throughout the documentation because
there's a great deal of behavior to describe.
(Even POSIX doesn't rigorously define "interactive shell" [*].)
I understand that this approach might be intellectually unsatisfying,
but it avoids ontological hangups. Rather than thinking very hard
about what "interactive" means, ask "how does [behavior X] change
in an interactive shell?"
[*]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_198
--
vq
Messages sorted by:
Reverse Date,
Date,
Thread,
Author