New implementation of pseudo console support (experimental)

Thomas Wolff towo@towo.net
Fri Jul 17 14:59:56 GMT 2020


Am 17.07.2020 um 14:47 schrieb Thomas Wolff:
> Am 17.07.2020 um 13:19 schrieb Corinna Vinschen:
>> Hi Takashi,
>>
>> On Jul  1 20:47, Takashi Yano via Cygwin-developers wrote:
>>> On Fri, 29 May 2020 00:40:24 +0900
>>> Takashi Yano via Cygwin-developers <cygwin-developers@cygwin.com> 
>>> wrote:
>>>> On Tue, 26 May 2020 10:09:55 +0900
>>>> Takashi Yano via Cygwin-developers <cygwin-developers@cygwin.com> 
>>>> wrote:
>>>>> On Mon, 25 May 2020 19:53:32 +0900
>>>>> Takashi Yano via Cygwin-developers <cygwin-developers@cygwin.com> 
>>>>> wrote:
>>>>>> On Tue, 19 May 2020 22:40:18 +0900
>>>>>> Takashi Yano via Cygwin-developers <cygwin-developers@cygwin.com> 
>>>>>> wrote:
>>>>>>> On Sat, 16 May 2020 16:47:35 +0900
>>>>>>> Takashi Yano via Cygwin-developers 
>>>>>>> <cygwin-developers@cygwin.com> wrote:
>>>>>>>> On Sat, 16 May 2020 09:29:56 +0900
>>>>>>>> Takashi Yano via Cygwin-developers 
>>>>>>>> <cygwin-developers@cygwin.com> wrote:
>>>>>>>>> Fix a small bug caused when stdio is redirected to another pty.
>>>>>>>> Fix another bug caused when stdio is redirected to another pty.
>>>>>>> Revise the patch to fit the current git head.
>>>>>> Revise the patch again to fit the current git head.
>>>>> Make app, which reads stdin, work under gdb.
>>>> * Prevent ResizePseudoConsole() calls unless the pty is resized.
>>>> * Revise the patch to fit the current git head.
>>> Revise the patch to fit the current git head.
>> are you satisfied with the code?  If you want to merge it,
>> I'd bump Cygwin to 3.2.
> (blush) I apologize, I had promised to run my test cases.
> Beginning with it, the first succeeded, the second failed:
> run notepad (from mintty), click back into terminal, enter ^Z
> It says "Stopped" but the process is gone.
>
> Continuing may test suite soon...
OK, so here are finally my updated test results:


resize terminal while running Windows cmd
run cmd, resize, run dir/P:
✓works


terminal reports in response to request escape sequences
("\033[6n", "\033[0c", "\033[>c", '\033[18t', '\033]10;?\033\')
✓works


output to alternate screen
echo -e "\e[?1047h"; cmd
✓works
cmd
from other terminal: echo -e "\e[?1047h" > /dev/pty...
↯no output; weird behaviour on ^C, mintty terminating (also in 3.1.6)


signal handling/mediation; catch SIGTSTP
run notepad, click back into terminal, enter ^Z
↯fails, notepad is terminated
-> this is a regression, ^Z,^C,^\ used to be ignored


character set conversion from Windows cmd line program
run xcopy (Windows system language e.g. German), watch error message
✓works in Unicode terminal
✓works in non-Unicode terminal (e.g. LC_ALL=C.CP850 mintty)


handling non-ASCII characters in non-Unicode terminal + native interworking
LC_ALL=en_US mintty, check locale charmap -> ISO-8859-1
echo ö | od -t x1 -> 0xF6
✓works
cmd /c echo ö | od -t x1 -> 0x94
↯fails (also in cygwin 3.1.6)


using wincon.c, compiled with x86_64-w64-mingw32-gcc
run program, check colour of second output, give non-ASCII input, check echo
✓works in Unicode mintty
✓works in non-Unicode mintty


using attached wincon.c, compiled with gcc
run program, check colour of second output, give non-ASCII input, check echo
↯no output (regression, works in 3.1.6)


using attached program sgr.java
run program, check coloured output of middle characters
✓works (did not in 3.1.6)

-------------- next part --------------
#include <wchar.h>
#include <windows.h>

void main()
{
  wchar_t * s = u"bäh 3€ 啕\n";
  HANDLE conout = GetStdHandle(STD_OUTPUT_HANDLE);
  DWORD len;

  WriteConsoleW(conout, s, wcslen(s), &len, 0);

  SetConsoleTextAttribute(conout, FOREGROUND_GREEN);
  WriteConsoleW(conout, s, wcslen(s), &len, 0);

  wchar_t buf[99];
  HANDLE conin = GetStdHandle(STD_INPUT_HANDLE);
  ReadConsoleW(conin, buf, 9, &len, 0);
  buf[len] = 0;
  DWORD len1;
  WriteConsoleW(conout, buf, len, &len1, 0);
}
-------------- next part --------------
import java.io.*;

public class sgr {
    static public void main(String[] args) {
        System.out.println("abCDef");
    }
}


More information about the Cygwin-developers mailing list