delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/05/07/06:18:31

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1C252383F869
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1588846665;
bh=NJjEVfixQj0XuBz/1ameqObP+jHfx1m0VU/5wSpACk0=;
h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=bjK2io2q7J/t2LB5EPzBa1hi6bofv/V2H7dA0p/VBcf8xOLsQkYbUF3E64X08wEU+
VWZ5DFTYF0Cj4bebgfAABEMmZRhC5SFcWaUbvXzf/RK69s4thRsKhQSWDJdBNnDL7S
SocTX3YAyKRpS+AtwLErcM5nFIRrdAMWXoHNi9DY=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C4216386F44C
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
To: cygwin AT cygwin DOT 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: <MN2PR04MB63843D8BFF4392E3B328A72493A50@MN2PR04MB6384.namprd04.prod.outlook.com>
References: <MN2PR04MB63843D8BFF4392E3B328A72493A50 AT MN2PR04MB6384 DOT namprd04 DOT prod DOT outlook DOT com>
X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Mime-Version: 1.0
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 AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <http://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <http://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Takashi Yano via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>
Errors-To: cygwin-bounces AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 047AIBrB013426

Hi André,

Thanks for the report.

On Thu, 7 May 2020 03:38:25 +0000
André Bleau via Cygwin <cygwin AT cygwin DOT com> 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 <iostream>
> 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 <windows.h>
...
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 <takashi DOT yano AT nifty DOT ne DOT jp>
--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019