X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F1618385842D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1681442520; bh=ndKmjolgHLVq+wEL/YIDwA/kFME+fhc/7N+hacnuBA4=; h=Date:To:Cc:Subject:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=sixlvDQLnKsy4GsEc4606/e4EXR/3Nyr2UTHn2rJX9rUJfZacyL7SnU4kB9vIgQGX 4hMN5oT/kXtXJ4rRrQMkXH4UPkg5ZlgmkzMWFvBU/MyhOKe0QpADgHHlgVC+65n8mQ 0VfKq8ElEWpfqPK1YjVfo9vKdePIfRAKTxOSMlvk= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E19163858D20 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com 33E3LECh021008 X-Nifty-SrcIP: [220.150.135.41] Date: Fri, 14 Apr 2023 12:21:15 +0900 To: cygwin AT cygwin DOT com Cc: Wladislav Artsimovich Subject: Re: [Bug] No Keyboard input when using interactive commands with stdin via pipes Message-Id: <20230414122115.0717443f466c083f1c20a469@nifty.ne.jp> In-Reply-To: <20230411082225.Horde._PTWsCm_YLV1M7wEp3hKuyr@localhost> References: <20230411082225 DOT Horde DOT _PTWsCm_YLV1M7wEp3hKuyr AT localhost> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 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 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Takashi Yano via Cygwin Reply-To: Takashi Yano Content-Type: text/plain; charset="utf-8" Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 33E3MNX3000931 On Tue, 11 Apr 2023 08:22:25 +0000 Wladislav Artsimovich wrote: > 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? Thnaks for the report. I cound reproduce your problem by: $ yes | cat -n | more.com (not /usr/bin/more but /cygdrive/c/WINDOWS/system32/more.com) Currently, the keybord inputs are sent only to 'yes' rather than 'more.com' in the above case. This does not happen in: $ yes | cat -n | less because less is a cygwin program which opens '/dev/tty' rather than 'CONIN$'. Anyway, I'll fix that. -- Takashi Yano -- 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