From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 26179 invoked from network); 21 Oct 2021 12:40:39 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 21 Oct 2021 12:40:39 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1634820039; b=RB1v3YbkEO9MnMe9XFpPGszyVcRooCitJ26xOA9dSlmN0758z37pOojaK/d+668rrp9n0uA7id PM0CfacBJclYkw06/bJLKjd/oxoRgyQcQSvvvAHQIKuioxD0gNfxln8Ok5ePANFSxF7bocFDn/ TF5O0qQaz1xk616BCaW9BUZfGx6hOWXezX5KX4TSdHlwmUCqYbOOzrH9W8sbHHGuvIO7PRWdja n+pE6WWQiIwzjSUTRKSWuBn65te9NIC4iS8KktWiJqXTmTs3ECZWiD5+CL0FWrX0VYE1hvDaAx JOhvqxo4NrmAMdACRl6fP/Nu5NgrMWTzQHkcx64+0PCckA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (shout01.mail.de) smtp.remote-ip=62.201.172.24; dkim=pass header.d=mail.de header.s=mailde202009 header.a=rsa-sha256; dmarc=pass header.from=mail.de; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1634820039; bh=1AZ+LnP/byaxbDU+W8TP3S2CMkNkQ74Sv5od0FN7Bz8=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:Date: Message-ID:To:Subject:From:DKIM-Signature:DKIM-Signature; b=IhFSHGBMjOhxqB3+4iJjbczCIV1sjYGPuHW9UjX+YqFGKjsr5XM/iuE1vDwoc4LMoJrcNstzg6 wO2kKnB2NnLf1HQvTmFOYBcrFyKDJZq3wUxc5TTnmNc46pmJyzoTz8rpDvVNNMgYt/pVL8whtS ADyr29qz3vEikfSAJnn6rkK5Fpc5x1psTxYV75or0Y/ZQv5+HYLicCnNS16iutsBW+dURYLOsx YTkiRAZ5maeVtuLIZe81udMvn1WAw+TvQ26MhSPm7LV4o+LT9dSL/rNO7ahCwwtNjGmQ4gJRwi aW24aY9dMT+ddn0XoZgoE+rezrOZxzsURnd/ittyGaNl0w==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Date:Message-ID:To:Subject:From:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=xYP7bSGKeIrsP8lSR6mvBx3nSO1pgn5enoO9mKf2e8w=; b=Zx4G8e5YH8SG/NmTglogms59Fe WP9ucf4pyIBlsqOBhe/S9JMjw7uScrEm8CGd8X6/t/ocmlIXxJxp4SYdMlgYHa28T2ECtynJs0cJm nGM0eiRVcLtE9nPbg15g7AeJWh6KacA0EIrLjtpc08ASs5eRx0lcYPc4lDFUYgLBgJNysmT7g7d/F HevfE72rKWiR5VKoVBHJqMzx7u//6WJN63xbaGDfIS7+yuWtZagnSJUQMuQtZwJCRgAcLvoBq2kNw 9umDxEdweY7OpYglVb5b7Op0jSwmwoIH3YidEke5PeCRMvDsUC6vpl62lynCnuNnPTaIi2cNVht4u /pwDg5jg==; Received: from authenticated user by zero.zsh.org with local id 1mdXN9-0002qg-8i; Thu, 21 Oct 2021 12:40:39 +0000 Authentication-Results: zsh.org; iprev=pass (shout01.mail.de) smtp.remote-ip=62.201.172.24; dkim=pass header.d=mail.de header.s=mailde202009 header.a=rsa-sha256; dmarc=pass header.from=mail.de; arc=none Received: from shout01.mail.de ([62.201.172.24]:53323) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1mdXMu-0002Xk-49; Thu, 21 Oct 2021 12:40:24 +0000 Received: from postfix01.mail.de (postfix02.bt.mail.de [10.0.121.126]) by shout01.mail.de (Postfix) with ESMTP id E5D53100999 for ; Thu, 21 Oct 2021 14:40:22 +0200 (CEST) Received: from smtp02.mail.de (smtp02.bt.mail.de [10.0.121.212]) by postfix01.mail.de (Postfix) with ESMTP id CD572A03C4 for ; Thu, 21 Oct 2021 14:40:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.de; s=mailde202009; t=1634820022; bh=1AZ+LnP/byaxbDU+W8TP3S2CMkNkQ74Sv5od0FN7Bz8=; h=From:Subject:To:Date:From; b=jD4LJWnStr5O4Jk0TGeOIN1HSDJFIDAgF4HRrFyyYh/tZBrfYRMsGSLVDsdJM4cXp 7HRqT8Ryn351b/Em/Sx+SpCHXwPKa0zGpT1RY2UCG/2BURzQWANsoiqh62Ug0iNw91 5gVkHZeCwuETG3d2ba9ojAgD5JuzVwPb6fU7Yu/8x6FR18c4jwCdAcpTtjQX2g4Uen BnuMAOwLI4b6wTSy+X18+HdnCi0h2tXcsfCLgC3ikIsF0loKzh24BS/Vrj19/VY9VB myBBZDqZrksD2KpK8738as+e09VT0BYxojjYGuS25uM6+KY84h5VLtDZinnd5JSweg xSoSgNDbcbyGw== Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtp02.mail.de (Postfix) with ESMTPSA id 8A717A03B9 for ; Thu, 21 Oct 2021 14:40:21 +0200 (CEST) From: Tycho Kirchner Subject: Unexpected stdin-behavior To: zsh-workers@zsh.org Message-ID: <2abd99f9-c1c0-1385-f8b4-be9b8f14c4d9@mail.de> Date: Thu, 21 Oct 2021 14:40:14 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 1329 X-purgate-ID: 154282::1634820022-0000784B-E4BDEE41/0/0 X-Seq: 49502 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: 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%