X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0E428395B057 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1588862481; bh=ZrT2OMpG3UJ2DAdt8213IKPAqxl0XLp1CGqHnNoQGwQ=; h=To:Subject:Date:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=uqX7rc4WmYuiXCvtfNqh9RtiINnKz39UfClcDBYksgF8Jo5vKqj4qM8cx7keW1iUg wsZtLryqK/pfCHyrbwke99YlmUEJT+mlCzggoX+6hAOaS17Jq4T6PFmZ3pbSD88TG3 m9Y3X8gV4PWaXqZKvo8AK8kT3b2rxBo3X4HmQamI= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7F90B3870846 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FCF/YZODtfP5wOqdeN0DigoxVnFfd8CjJrzQSwgBW6ZukRG5kGtNQlc8iaCbVQ+LVDKH1O8qQFfdZ61OIbE04IHc2GRmOhS7LTtcfRh6DyTmcDmRG+6aNQFmtRzZMcRElT0hGn2iEuWZ7G0HIPYweu92AB8Ejpr45Un7JGwgVNUvEfbz7A7coMep+xzsIqHOVGt70m2gjW2hWxZhLKPpSdUjZfEn2qwGFY4joH5YVujN7FVp6zFTcc9rGL5uKOQSI1QSDW003nm4WXCGMAad36zULKf1Jac88JtQjBbzuesQPnlte7OYhKju45/SGHXuGNVFCOuIBX0F8clotL5eeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gsVAKDQdNWcKLgI/HTDMP/sSayGqNbHTA3dFhcPbfrc=; b=VYsE2V53oWZ/vMJ82rLhm6VS3/8Wx3fEjMESKDUIle6HIkA2UMT7pZAQ1D4PFF/Oo2smiVB4hcRI2f0kMy9jRGlkErdZnRLmHK0grX7ssWn5uCh2/ba2BWKkcZAm5lwyxVJQiwI3ZIe59bWygD6P2pSbhs7/qdiwhS7q0p4rgEW6OTbNNmNUy1ut1AHr9HPKMugVdLi3oMJ/FXaCxVUQZEni7JIBArInrexidWWZ681PukdpzWzu+3h1P4cuUOzNBzDeD9LQrLbbIowAOMBsZVZSjlJJB5Y7Bn/Av7uhR8k6iEPT+f1lPKVkmbkChEIULIzLHYYLC6EbobWZn0JshA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none To: "cygwin AT cygwin DOT com" Subject: Re: Problems with a combination of a mingw program, mintty, and CYGWIN=disable_pcon Thread-Topic: Problems with a combination of a mingw program, mintty, and CYGWIN=disable_pcon Thread-Index: AQHWJBqRl4Thy+f3TUe8HOxPs6713KicaR2AgABFuyM= Date: Thu, 7 May 2020 14:41:17 +0000 Message-ID: References: , <20200507191707 DOT 48a948b5c573592d9d293f7a AT nifty DOT ne DOT jp> In-Reply-To: <20200507191707.48a948b5c573592d9d293f7a@nifty.ne.jp> Accept-Language: fr-CA, en-US Content-Language: fr-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:0662CDBC611E3B8F51D709481891C95E5D0C0A8792061D588DE772E85362D015; UpperCasedChecksum:B16001DA3C8212B0220F0832E934CF6F73CAE7BE24EB207E85C82E043B9C6730; SizeAsReceived:7072; Count:45 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [fIWV/0H2NyLsOyTaMB9uA/if/6SvwvmZ] x-ms-publictraffictype: Email x-incomingheadercount: 45 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: b8fa8258-5628-44ad-dc88-08d7f294b390 x-ms-traffictypediagnostic: BN8NAM11HT026: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: igkvK4MxG15MkS+yMfbEQxVzB2nu+g5D5k5huHdsM1CPJOgGA5ckVeEuXNYqDkgfhsP4wC9bXGPlXvPeHXhB1vbsft36KtuVAAubZJrsLPQvrgpvYfDlSzGOBUyWN1xIqbO2TB6MLeNdoOerkC+1rRzvCDchdv1gdJYDjbDZgPuK78A1WU1+nEDIiPu1OeMr3YCJyjC/6kQGJP8fg5qHvA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:0; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR04MB6384.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:; DIR:OUT; SFP:1901; x-ms-exchange-antispam-messagedata: qSv0NK3nNRHlCOM9AuCl8ILAqoPFdH+XFszQ0KpVFuIiproRElXOeDwKabiKR27uj/hAmH7+GDoGApGIRxN9FyA7Hnn6inEF1on/vPUdL/JsOs9gf8r7VVwcuyATv5cgkdN7Mxz9WpeE8i27WgS2Mw== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: b8fa8258-5628-44ad-dc88-08d7f294b390 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 May 2020 14:41:17.6766 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8NAM11HT026 X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no 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 List-Archive: List-Post: List-Help: List-Subscribe: , From: =?utf-8?q?Andr=C3=A9_Bleau_via_Cygwin?= Reply-To: =?iso-8859-1?Q?Andr=E9_Bleau?= Content-Type: text/plain; charset="iso-8859-1" Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id 047Efll6009831 Takashi Yano wrote: ________________________________________ 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 ________________________________________ Hi Takashi. Thanks for the quick response. Adding these lines of codes to my program and to the simple test case mentioned solved the problem of gaps in lines when run from mintty with pcon enabled. However, it does not solve the problem of mintty misbehavior when started from a bash script to run the same program. Maybe this is a problem that Thomas Wolf would be interested in. Regards, - André Bleau -- 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