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

Unexpected stdin-behavior



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%








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