Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Unexpected stdin-behavior
- X-seq: zsh-workers 49508
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Tycho Kirchner <tychokirchner@xxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Unexpected stdin-behavior
- Date: Thu, 21 Oct 2021 12:14:57 -0700
- Archived-at: <https://zsh.org/workers/49508>
- In-reply-to: <13d30855-d91c-7def-6834-f0ec24cfd598@mail.de>
- List-id: <zsh-workers.zsh.org>
- References: <2abd99f9-c1c0-1385-f8b4-be9b8f14c4d9@mail.de> <CAH+w=7Ype8LCU4nywbNwjbTQ4G6sfa3yihNfZUtsnLBi7CJ0kA@mail.gmail.com> <13d30855-d91c-7def-6834-f0ec24cfd598@mail.de>
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.
*/
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author