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

Re: Unexpected stdin-behavior

Am 21.10.21 um 21:14 schrieb Bart Schaefer:
On Thu, Oct 21, 2021 at 9:47 AM Tycho Kirchner <tychokirchner@xxxxxxx> 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.
     if (isset(SHINSTDIN) && !SHIN && unset(INTERACTIVE)) {
#ifdef _IONBF
         setvbuf(stdin, NULL, _IONBF, 0);

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

Indeed, in the latest dev-version both behave the same. I think *now both behave wrong*, instead zsh -s -i should behave the same as zsh -s did previously, not the other way round.

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