X-Recipient: archive-cygwin AT delorie DOT com X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6A6CB3857836 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=nifty.ne.jp Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=nifty.ne.jp DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com 25F4ggVF009396 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.ne.jp; s=dec2015msa; t=1655268162; bh=xwcry56PI+PMY/LlyxvTmh+E8Rsegf3mXPEtP6rZskw=; h=Date:From:To:Subject:In-Reply-To:References:From; b=NrWSnv+70fhZY2e20dSunWS3idqD09Dm+DNUyfL3vbuiNlVWxqvebAYRqkczgkqby M1xUYRmuQGfv3US6P37sukp8chKeI/kLlitx9GSCT3J7hDo7oAELsfTuHRuTtnMPLQ D2Mw9/fyGpliiHHEw1qRipe2qh/Ks1bcj0y6huHlcY9EOfHUEICQf9j5Bh420nu/92 eEiV6w5sooOgH5GMCx+ASlsdtrxQVUY7dMXnBYQ1hT2wrcbys0hnuUJ1fnDC32uYC4 UDnmV4g3snnQ6iNXf+2okp/lLjQFGC3JhFte5PCqQ6B8Sg+ogQ1bGf/2lGQVz07xo+ ltT4VOeh9dXjA== X-Nifty-SrcIP: [119.150.44.95] Date: Wed, 15 Jun 2022 13:42:44 +0900 From: Takashi Yano To: cygwin AT cygwin DOT com Subject: Re: "cat" breaks ANSI codes on Windows Terminal when piping stdout to python or golang Message-Id: <20220615134244.02b345113b4dc5e6de54de03@nifty.ne.jp> In-Reply-To: <20220615100407.3baf4651172e52ce33181819@nifty.ne.jp> References: <1qctAGvnk1sjfU-ob9Y_DTSQIMpPGIn6lDmSoU0JKGPa_EDZkIMYP65gYufkeEVyPX0WCmJDQAJAmGf13IpPPHUmmchN17WDX4PyRxt2omE=@protonmail.com> <20220614194753 DOT e06a3ff4e6be224249956e50 AT nifty DOT ne DOT jp> <20220615100407 DOT 3baf4651172e52ce33181819 AT nifty DOT ne DOT jp> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 X-Spam-Status: No, score=-5.3 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, T_SCC_BODY_TEXT_LINE 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" On Wed, 15 Jun 2022 10:04:07 +0900 Takashi Yano wrote: > On Tue, 14 Jun 2022 21:56:39 +0000 > 5990 wrote: > > I ran all commands on cmd from within Windows Terminal. Note that running cmd.exe directly, and running cmd from the Windows Terminal is not the same. cmd.exe does not support ANSI codes. > > My question was: > What shell (command user interface) did you run in Windows Terminal? > By default Windows Terminal runs 'Windows PowerShell', however, you > can also run 'Command Prompt' (cmd.exe) in Windows Terminal. You also > can run cygwin bash if you add configuration. What does tab on left > upper of the window of Windows Terminal say? > > > Also, what do you mean you can't reproduce the issue? Was it because of insufficient information, or because the commands worked perfectly on your system? > > I meant 'cat empty.txt | go run color.go' outputs cyan 'golang-test' > text. > > > I noticed you didn't include python information in your environment. You can install the missing lolpython dependency from PiPy by running `pip install lolpython` > > Which python implememtation do you use? I guess you do not use cygwin > python. Microsoft store version? Or did you download it from > https://www.python.org/downloads/ ? > > I installed Microsoft store version of python (3.10.5) and run > 'cat empty.txt | python color.py' from PowerShell in Windows Termianl, > then it outputs gradate-colored 'python-test' text. It has been confirmed that the patch: https://cygwin.com/pipermail/cygwin-patches/2022q2/011935.html fixed the issue. Thanks. -- 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