zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Tycho Kirchner <tychokirchner@mail.de>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Unexpected stdin-behavior
Date: Thu, 21 Oct 2021 12:14:57 -0700	[thread overview]
Message-ID: <CAH+w=7Y_3DBPO=AfYBnKmFUN3cdffGB=65z4BepmtQBJgBGd9w@mail.gmail.com> (raw)
In-Reply-To: <13d30855-d91c-7def-6834-f0ec24cfd598@mail.de>

On Thu, Oct 21, 2021 at 9:47 AM Tycho Kirchner <tychokirchner@mail.de> wrote:
>
> thanks for your response. Could you please elaborate how your answer
> explains the difference in the output between the commands
> zsh -s and
> zsh -s -i
> ?

When -i is NOT present, stdin is set to line buffered for the stdio library.

I don't actually see any difference between -s and -s -i except for
the printing of the prompt, when I try it with the latest development
version, and the only code difference is the removal of stdio.  This
is probably an unintentional behavior change in the new code, and may
bear looking into.

For zsh-workers (particularly PWS), I'm referring to this bit of code in init.c:

    /*
     * Finish setting up SHIN and its relatives.
     */
    shinbufalloc();
    if (isset(SHINSTDIN) && !SHIN && unset(INTERACTIVE)) {
#ifdef _IONBF
        setvbuf(stdin, NULL, _IONBF, 0);
#else
        setlinebuf(stdin);
#endif
    }

We either don't need the set*buf business at all, or we need its
equivalent for shinbuf, I think.


  parent reply	other threads:[~2021-10-21 19:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-21 12:40 Tycho Kirchner
2021-10-21 15:55 ` Bart Schaefer
     [not found]   ` <13d30855-d91c-7def-6834-f0ec24cfd598@mail.de>
2021-10-21 19:14     ` Bart Schaefer [this message]
2021-10-22 10:28       ` Tycho Kirchner
2021-10-22 10:58       ` Peter Stephenson
2021-10-22 14:24       ` Tycho Kirchner

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='CAH+w=7Y_3DBPO=AfYBnKmFUN3cdffGB=65z4BepmtQBJgBGd9w@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=tychokirchner@mail.de \
    --cc=zsh-workers@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).