X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 99374385841E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1681201387; bh=F7711CJwlG5RtLSXeiz7/SDLRarbOUjZ5ImX/nQIlRw=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=UveCvx6oq9CIRC5IU5z0jwaFPjUtpOsNZAM4mJn1B3aqBk/XjxIbyue5Ipuv7yRYY HBk+hV8/o7rZFt+qyKQCLS9X8f4MDJad3mfkCMBRkssH3k2oT3AJ3BuB89DvkFmunb yxHvOMZ6Kq57OEAeR3+ZxNFbzJ4rV1IYvGzKzRp0= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 55CDF3857BB2 To: cygwin AT cygwin DOT com Cc: Subject: [Bug] No Keyboard input when using interactive commands with stdin via pipes Message-ID: <20230411082225.Horde._PTWsCm_YLV1M7wEp3hKuyr@localhost> User-Agent: Horde Application Framework 5 Date: Tue, 11 Apr 2023 08:22:25 +0000 MIME-Version: 1.0 X-Provags-ID: V03:K1:q5zJCZl9yayPp9D79dcqsDn6jkujUNCLbCKXpdp0uLWfkhvQS4M w8jFzgquxDJd7NIH8Yd4NBQucRms54DLyar1HsBxSNy4jFdyh6yDrdOw4MA/hvkj7rAudaj 23GDigJ1TdEK01NgvXKlBtiDKmNbJA8RVuEm+HVx8xy15Eu1gfQIrC5cZ0g5WOf907AtOtg 56DKe0gJ9z3PJ60J4FlfA== UI-OutboundReport: notjunk:1;M01:P0:/dYG3erbpO0=;WbsRgepPgqp7VQAUzPPAvP5tZLt zwXXHRCrUcWml6olTDu70ejN/kQciWO3SDWwsB8l8SMouJ5aGcLpHprfrnXebhjfoM/C6T8qr Pidc5GOwBqJOJO8WyBNubXjlMzXEE+CpscXXlG8CFDjLzrwajFW1IhGViDeqzbZnyeGQMyyvG ex15aDc2th/SEijS2OkrfFqqSanIuC5HgHUX4iywDDGtu5xGqfyhv6RlyYewYH/jWnuTzzABz haQHpa563vYJowroZQQmb7ua22MtXGQqr1oFws4nHG/wq4/xt+F3Guw/3sWVfz23DT+sHq/sJ KHwYU+RpfR6vkWai4wk+c+7hAMOaw3+VL3sBxjtdlHIfMw4BWCq0dIBxFFJgT+5zuBgLImmSS 5jQuQF7lEfLD738ySzDIUQV5ZdNXL2QH6X88iMKPytRHLR476m3p7XdDZOucl1o8uKGno8Ms6 L1MBKpxuN0X+BxYM0ZyzRJ6glRkZJhTwaBXilXW/hVtUDCHXJqiNqRqmm1BZ5znhQDWrMKbxS rrLoSVKSiQCoQAS5AXXGDQefWLwX11uBSqdL2Hvj2nZhUeGvi7O0cWy9Aiadsxd/pGaTHCqYk 5xG7xigz11TKQVaTRNKbER6uzu5Kw963obb2JeuUxBjFnWNFGKP82AWUCg1WYAuhELEGZUS6Y Pk6Gt2D239P4HWFM7CRtUnGbbT8xlIGjsosqzywr3g== X-Spam-Status: No, score=3.3 required=5.0 tests=BAYES_05, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: *** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 List-Id: General Cygwin discussions and problem reports List-Archive: List-Post: List-Help: List-Subscribe: , From: Wladislav Artsimovich via Cygwin Reply-To: Wladislav Artsimovich Content-Type: text/plain; charset="utf-8" Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 33B8NUQj029509 Dear Cygwin users,   there appears to be a bug or a missing implementation detail in either unix pipes or ConPTY, which prevents interactive console programs from receiving keyboard input, when they get stdin via a pipe. This report concerns the following Github issue, originally started in the MinTTY Terminal emulator Repo: https://github.com/mintty/mintty/issues/1210   There are multiple programs, which fail to receive any kind of keyboard input when used in MinTTY and when their stdin input is supplied via a pipe. This has been reported multiple times in the MinTTY repo already.   Examples include:   - `fzf`, which works normally when being called, but stops working properly if it receives a file list via a pipe. Eg.: `fzf` by itself works fine. but `find . | fzf` fails.  - By extension, the zsh plugin fzf-plugin fails for the same reason, when opening the command history  - The program fx ( https://github.com/antonmedv/fx ) which successfully receives keyboard input for navigating a json file, Eg.: `curl -s https://api.openai.com/v1/chat/completions -H 'Content-Type: application/json' > test.json; fx test.json` but fails when getting the json data as a direct pipe: `curl -s https://api.openai.com/v1/chat/completions -H 'Content-Type: application/json' | fx`   This happens with MinTTY accessing the MSYS2 environment on Windows. Interestingly enough, this does not happen with Alacritty accessing the MSYS2 environment on Windows. With Alacritty everything is fine, which made me initially suspect MinTTY as being the culprit. However, the MinTTY repo lead diagnosed this issue to come from Cygwin, which is why I write report the bug in this mailing list.   Is there something that can be done about this? Can I provide additional debug info or logs to help fix this?   Best regards,   Vlad -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple