From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from conssluserg-05.nifty.com (conssluserg-05.nifty.com [210.131.2.90]) by sourceware.org (Postfix) with ESMTPS id C4216386F44C for ; Thu, 7 May 2020 10:17:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C4216386F44C Received: from Express5800-S70 (v040007.dynamic.ppp.asahi-net.or.jp [124.155.40.7]) (authenticated) by conssluserg-05.nifty.com with ESMTP id 047AGv38032239; Thu, 7 May 2020 19:16:57 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com 047AGv38032239 X-Nifty-SrcIP: [124.155.40.7] Date: Thu, 7 May 2020 19:17:07 +0900 From: Takashi Yano To: cygwin@cygwin.com Subject: Re: Problems with a combination of a mingw program, mintty, and CYGWIN=disable_pcon Message-Id: <20200507191707.48a948b5c573592d9d293f7a@nifty.ne.jp> In-Reply-To: References: X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin@cygwin.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: , X-List-Received-Date: Thu, 07 May 2020 10:17:44 -0000 Hi André, Thanks for the report. On Thu, 7 May 2020 03:38:25 +0000 André Bleau via Cygwin wrote: > Hi cygwin users, > > I have cli program that I run with mintty. It is a simple C++ program, reading from cin and outputing to cout. It is cross-compiled as a mingw program. I've been running it without problems fro over 2 years. Recently, I updated cygwin to 3.1.4-1 and noticed the pcon support. Since then, the output of my program has been messy: output lines have intermittent gaps in them. I made a simple test case that reproduces the problem, from the following simple C++ file, hello.cpp : > > #include > using namespace std; > static string Green = "\033[32m"; > static string Yellow = "\033[33m"; > static string Reset = "\033[0m"; To use escape sequences in pseudo console, please add the following code just like in normal cosole (command prompt). #include ... DWORD mode; GetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), &mode); mode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING; SetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), mode); This should solve your problem. -- Takashi Yano