This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ANNOUNCEMENT] TEST: Cygwin 3.1.0-0.1


On Mon, 12 Aug 2019 15:01:52 +0200
Corinna Vinschen wrote:
> On Aug 11 09:27, Thorsten Kampe wrote:
> > * Corinna Vinschen (Fri, 9 Aug 2019 20:53:38 +0200)
> > > I uploaded a new Cygwin test release 3.1.0-0.1
> > > 
> > > This release comes with a couple of new features and quite a few
> > > bug fixes.
> > > 
> > > The most interesting change, courtesy Ken Brown, is a revamp of the
> > > old FIFO code.  It should now be possible to open FIFOs multiple times
> > > for writing, something the old code failed on.
> > > 
> > > 
> > > Please test.
> > 
> > I've noticed two things in connection with pspg 
> > (https://github.com/okbob/pspg) - a pager for tables:
> 
> Nobody from the dev team uses this application, afaics.
> 
> To help tracking down the cause for the problems, can you bisect
> Cygwin or at least check which of the snapshots from
> http://www.cygwin.com/snapshots/ introduces the problem?
> 
> > 1. Configuring the source takes ages (for instance "checking 
> > whether the C compiler works..."). This is only in ConEmu, not 
> > in MinTTY.
> > 
> > 2. Pager output is completely distorted:
> > 
> > Before:
> > > SELECT ArtistId FROM Chinook.dbo.Album WHERE ArtistId = 78
> > +------------+
> > | ArtistId   |
> > |------------|
> > | 78         |
> > +------------+
> > (1 row affected)
> > Time: 0.356s
> > 
> > After:
> > > SELECT ArtistId FROM Chinook.dbo.Album WHERE ArtistId = 78
> > +------------+
> >               | ArtistId   |
> >                             |------------|
> >                                           | 78         |
> 
> If this all occurs in ConEmu only, it may be one of the end of March
> patches which may introduce incompatibilities with ConEmu's Windows
> API hooking, but that's just a blind guess:
> 
>   6a06c6bc8f84 Cygwin: console: fix key input for native console application
>   f4b47827cf87 Cygwin: console: Make I/O functions thread-safe
>   8382778cdb57 Cygwin: console: fix select() behaviour
>   bd627864ab41 Cygwin: console: support 24 bit color

I looked into this problem, and found that this is due to a bug
of ConEmu.

Attached is the simple test case (conemu-chk.c).
In command prompt, the output of this program is:
AAA
BBB

However, in ConEmu, the output is:
AAA
   BBB

If ENABLE_VIRTUAL_TERMINAL_INPUT flag is set to console input,
it affects to console output and becomes so that the newline '\n'
does not cause carriage return. This is weird.

Thorsten, could you please report this bug to ConEmu developers?

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>
#include <windows.h>

#ifndef DISABLE_NEWLINE_AUTO_RETURN
#define DISABLE_NEWLINE_AUTO_RETURN 0x0008
#endif
#ifndef ENABLE_VIRTUAL_TERMINAL_INPUT
#define ENABLE_VIRTUAL_TERMINAL_INPUT 0x0200
#endif

int main()
{
	DWORD mode;
	DWORD len;

	GetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), &mode);
	mode &= ~DISABLE_NEWLINE_AUTO_RETURN;
	SetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), mode);

	GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), &mode);
	mode |= ENABLE_VIRTUAL_TERMINAL_INPUT;
	SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), mode);

	GetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), &mode);
	mode &= ~DISABLE_NEWLINE_AUTO_RETURN;
	SetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), mode);

	WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), "AAA\nBBB\n", 8, &len, 0);
	return 0;
}

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]