public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Takashi Yano <takashi.yano@nifty.ne.jp>
To: cygwin@cygwin.com
Subject: Re: [ANNOUNCEMENT] cygwin 3.2.0-0.1 (TEST)
Date: Wed, 10 Mar 2021 20:31:46 +0900	[thread overview]
Message-ID: <20210310203146.7107c223f5ebdfc037751e55@nifty.ne.jp> (raw)
In-Reply-To: <DM5PR19MB098682EB9872B14E3EE7E0C593919@DM5PR19MB0986.namprd19.prod.outlook.com>

On Wed, 10 Mar 2021 03:38:52 +0000
André Bleau wrote:
> Hi,
> 
> Last year, I reported a problem about console output with pcon support. For the simple test program, see:
> https://cygwin.com/pipermail/cygwin/2020-May/244742.html
> 
> I was told (https://cygwin.com/pipermail/cygwin/2020-May/244745.html) that I need to inset the following lines in my program:
> 
> #include <windows.h>
> ...
> DWORD mode;
> GetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), &mode);
> mode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
> SetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), mode);
> 
> It worked. 
> 
> Now, I just downloaded cygwin 3.2.0-0.1 and retested my program with and without the above lines. Both work correctly.
> 
> Are the above lines no longer necessary? In that case, it could be useful to say so in the release notes.

This is due to behaviour change of pseudo console itself.
In Win10 20H2 (and perhaps also in 2004),
ENABLE_VIRTUAL_TERMINAL_PROCESSNG is set by default in pseudo
console. However, older Win10 such as 1809, this flag is not
set. Therefore, you need to set this flag explicitly.

Also, in command prompt, this flag is not set even with Win10
20H2. So, I recommend to keep this flag set for portability.

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

  parent reply	other threads:[~2021-03-10 11:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-09 11:01 Corinna Vinschen via Cygwin-announce
2021-03-10  3:38 ` André Bleau
2021-03-10 11:06   ` Corinna Vinschen
2021-03-10 11:31   ` Takashi Yano [this message]
2021-03-10 13:43     ` André Bleau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210310203146.7107c223f5ebdfc037751e55@nifty.ne.jp \
    --to=takashi.yano@nifty.ne.jp \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).