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 E46703857038 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-03.nifty.com 25F145Go024861 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.ne.jp; s=dec2015msa; t=1655255046; bh=TI4dABpRpgszFHpr9S+EltV8qKxsrrf+4RrctRng7sQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=wmGspuUXrQw5hGlb5GWHqz/AdC/m4/IhIZx9ZP/10gsAHf3AJcDZ1oyZyKrZMaAw2 br2FFqx0r7RLzPF7+xfOFOyvTn13MHZd8ToHaGjP0pfxUfGcdb90AlZP2HksS4jiEd Vyxym7Gs63CJsLpTCoqi2/m/I7R0FDnc3In+lQ/zYPRX+UP65VB/cSo8pthgk5+JW0 bWgbS4O7e73d5W9Ezp5o7YD3l3B+ZrkzkJpg+Edb4inKu9s+pKahvLXZTaqCOeyKEY 4SLV0ZMjuPlOg9sODNmCY1l3jT+pKj/0OtVt1bxgcEfQsyOcYa7096Rff4N6xlgXu9 yqb46SIilUYDw== X-Nifty-SrcIP: [119.150.44.95] Date: Wed, 15 Jun 2022 10:04:07 +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: <20220615100407.3baf4651172e52ce33181819@nifty.ne.jp> In-Reply-To: References: <1qctAGvnk1sjfU-ob9Y_DTSQIMpPGIn6lDmSoU0JKGPa_EDZkIMYP65gYufkeEVyPX0WCmJDQAJAmGf13IpPPHUmmchN17WDX4PyRxt2omE=@protonmail.com> <20220614194753 DOT e06a3ff4e6be224249956e50 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: , Cc: 5990 <5990 AT protonmail DOT com> 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 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. -- 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