From: Tycho Kirchner <tychokirchner@mail.de>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Unexpected stdin-behavior
Date: Fri, 22 Oct 2021 12:28:46 +0200 [thread overview]
Message-ID: <d8607e63-0f3e-5586-7feb-7a63d9fda34b@mail.de> (raw)
In-Reply-To: <CAH+w=7Y_3DBPO=AfYBnKmFUN3cdffGB=65z4BepmtQBJgBGd9w@mail.gmail.com>
Am 21.10.21 um 21:14 schrieb Bart Schaefer:
> 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.
>
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.
next prev parent reply other threads:[~2021-10-22 10:29 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
2021-10-22 10:28 ` Tycho Kirchner [this message]
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=d8607e63-0f3e-5586-7feb-7a63d9fda34b@mail.de \
--to=tychokirchner@mail.de \
--cc=schaefer@brasslantern.com \
--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).