Cygwin 3.3.0: The programs compiled with "-mwindows" cannot read more than one byte from noncanonical mode TTY

Koichi Murase myoga.murase@gmail.com
Thu Jan 23 10:49:00 GMT 2020


2020年1月21日(火) 10:47 Takashi Yano <takashi.yano@nifty.ne.jp>:
> Thanks for the report. I could reproduce the problem under LANG=ja_JP.UTF-8.
> I have almost caught the culprit. Please wait for a while.

Thank you for the patch fixing the problem. I cherry-picked the patch
and tried it, but there is another problem.

Description:

  The programs compiled with "-mwindows" cannot read more than one
  character from PTY in a non-canonical mode in .  There was no
  problem before the patch "Cygwin: pty: Fix reopening slave in
  push_to_pcon_screenbuffer().".

Repeat-By:

  1. Open Cygwin Terminal (mintty)

  2. Compile the attached program with the following commands.

    $ g++ -o minimal2-con.exe minimal2.cpp
    $ g++ -mwindows -o minimal2-win.exe minimal2.cpp

  3. The expected behavior can be checked with `minimal2-con'.  After
    executing the command, please type some five characters.  The
    string `[RECV]' will be printed five times, and then the program
    will exit.

    $ ./minimal2-con
    [RECV][RECV][RECV][RECV][RECV]
    $

  4. However, with the compile option "-mwindows", we can only see one
    `[RECV]', and the program will hang.

    $ ./minimal2-win
    [RECV]


Best,

Koichi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: minimal2.cpp
Type: text/x-c-code
Size: 740 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20200123/e60c6d34/attachment.bin>
-------------- next part --------------

--
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


More information about the Cygwin mailing list