zsh-workers
 help / color / mirror / code / Atom feed
* Unexpected stdin-behavior
@ 2021-10-21 12:40 Tycho Kirchner
  2021-10-21 15:55 ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Tycho Kirchner @ 2021-10-21 12:40 UTC (permalink / raw)
  To: zsh-workers

Dear zsh-maintainers,

first of all, I'm not a mail-subscriber but please respond to this email 
anyway ^_^

I almost finished the (yet unpublished) zsh-integration of my 
shell-tracker shournal[1] and noticed some inconsistency on the handling 
of stdin during an integration test.
While bash -i and zsh -s show the expected behavior (stdin is "consumed" 
command by command) zsh -s -i seems to "consume" the whole stdin 
beforehand (see below). I there a rationale behind this?
What I actually try to do is running automated tests on an interactive 
zsh with prompts, preexec, etc by piping commands to it similar to the 
snippet below.

Thanks in advance
Tycho Kirchner

[1] https://github.com/tycho-kirchner/shournal

____________________________________________________________

debian-dell% echo $ZSH_VERSION
5.8
debian-dell% stdintest(){ printf 'echo one\nsh -c "while read -r row; do 
echo got row \$row; done" \necho two\n'; }
debian-dell% stdintest | bash  --norc --noprofile -i
bash-5.0$ echo one
one
bash-5.0$ sh -c "while read -r row; do echo got row \$row; done"
got row echo two
bash-5.0$ exit
debian-dell% stdintest | zsh -f -s
one
got row echo two
debian-dell% stdintest | zsh -f -s -i
debian-dell% one
debian-dell% %
debian-dell% two
debian-dell% %
debian-dell%






^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-10-22 14:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-21 12:40 Unexpected stdin-behavior 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
2021-10-22 10:58       ` Peter Stephenson
2021-10-22 14:24       ` Tycho Kirchner

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).