From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.134]) by sourceware.org (Postfix) with ESMTPS id AA22F3858D34 for ; Sat, 18 Jul 2020 20:57:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AA22F3858D34 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=towo.net Authentication-Results: sourceware.org; spf=none smtp.mailfrom=towo@towo.net Received: from [192.168.178.45] ([95.90.245.244]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Myb8P-1kmQHY0snd-00z15v for ; Sat, 18 Jul 2020 22:57:25 +0200 Subject: Re: New implementation of pseudo console support (experimental) To: cygwin-developers@cygwin.com References: <20200513211609.011d188c3a735b00d55591df@nifty.ne.jp> <20200514182859.c5236a8889ab3081d2e8c937@nifty.ne.jp> <20200514183420.c246647a6d9e396d42c6b47e@nifty.ne.jp> <20200516092956.74369d694d611b1dcd095607@nifty.ne.jp> <20200516164735.2a2ef183788b151e9185ef41@nifty.ne.jp> <20200519224018.746f6324badd8a5762df42b1@nifty.ne.jp> <20200525195332.cf60ab2f38d167a76513740e@nifty.ne.jp> <20200526100955.30b1a2baea517e0565f30db6@nifty.ne.jp> <20200529004024.0c2ac3c68b588bda987e0837@nifty.ne.jp> <20200701204751.27609a8f5701010468521a87@nifty.ne.jp> <20200717111912.GG3784@calimero.vinschen.de> <5a952942-239a-997c-9e5c-5ce8cfd0bfb0@towo.net> <20200718140510.707b46c536ae2b80f51e77f8@nifty.ne.jp> From: Thomas Wolff X-Tagtoolbar-Keys: D20200718225723953 Message-ID: <9f7a8e29-5a65-eead-e3d9-a5d135ea21c6@towo.net> Date: Sat, 18 Jul 2020 22:57:24 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200718140510.707b46c536ae2b80f51e77f8@nifty.ne.jp> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:QpNzcdyWvcq6fTfzyh+lSOohz7sKFga6y/P1rb3NxLjdWItvOEa AOL4inHjsLhnIflcME3nvK6mLINsBPJymejRKVW1o5PGJCPhgwkjyNk8nXaCmjP8y2rreg4 NMoQi0Wk3QyaF316SavhVSjqVABFyQLvDSCbxzQy3QakAt7QxoJ/a4rOj1Clnqp0IZOYvP0 sUiPZ7kfaRS1WL2gREjIw== X-UI-Out-Filterresults: notjunk:1;V03:K0:iGZ+U0MnRvk=:q9wKkfKnFFOz2tVLX7rE2Z rPDTkBn8yytj/4DPi17y2tZ1pZRuih5mJYT/teUWYsQ0Jrc5w8y/M/aNQdwbzjihXxjRAJXRZ DZSHsKqdQKSZ6hAJMMwXblZueIdd8FSaaqKlI8ifEP9kA4zOTA8lCTFs7BFFHpBZa3IQZVyJb 6i4qGrbojpLi8E3djah5wuWsgGyTeGtE0GKxygojEScTejCLFAbeGqZNfb8bn41/wbEAo5E2X uYEPfxEPl6bVPJWokU1ipfGp57tldObynIDbj6Ko7S7aksNQequPqQhtVqkBxHf14+BeJ6wLx qW7OMlty8YmDsrk6seAXEfupQcKtv1wZjpdWnfFlPWbDC9vpOlqj54aonY0tjSfILEbb6IibC LVnKRYfac7qOzU4+ATuYCSyl0R/FAPwIL2o3TPvHJ6zdU+RVJxQdnAfWHx9CJXQ9Zx0WUSRkj TJrG+L2JLQuuphyR15rxQMZ7V7c2Pd5Cz9Ok7k8w6sjctCVwvROL5s7n3rwn1BrXxLVN+381l ZceTBdn8gXlYJYmbhHwDOWJLQ+WIFuHgZdruW7GZMs2TzOw+FFMLEyN5vSOyYVMNjwozYq5e4 5qoJ2gY5uTs67yv5xDvh/QnX+f3obHdcmSgzo3drxeEQuq3NsqpERqSK2VQab7+an2etI4Sz4 hfybxSa5mPU96Y/hZrIn2QvWCpIjwb/NZyQpC7OUfKOF6ZjMHbIxf5uLYQZFmTutfh8arpezz djQOZ5MkUsjVObagv47mC3AUfqsbRrsptke+THIl0y9lugOKRHNSjluu4nk38ptjtJaI96SVQ 3wkCecv2lQRoZJnl+PLWFlQYU1lq4DX2NBR3ycjTVRfTQ9wC+dX9mo4CUM0NrzNzoVbIgiV X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, 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-developers@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component developers mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jul 2020 20:57:28 -0000 Am 18.07.2020 um 07:05 schrieb Takashi Yano via Cygwin-developers: > Hi Thomas, > > Thanks for testing. > > On Fri, 17 Jul 2020 16:59:56 +0200 > Thomas Wolff wrote: >> 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 >>>>> wrote: >>>>>> On Tue, 26 May 2020 10:09:55 +0900 >>>>>> Takashi Yano via Cygwin-developers >>>>>> wrote: >>>>>>> On Mon, 25 May 2020 19:53:32 +0900 >>>>>>> Takashi Yano via Cygwin-developers >>>>>>> wrote: >>>>>>>> On Tue, 19 May 2020 22:40:18 +0900 >>>>>>>> Takashi Yano via Cygwin-developers >>>>>>>> wrote: >>>>>>>>> On Sat, 16 May 2020 16:47:35 +0900 >>>>>>>>> Takashi Yano via Cygwin-developers >>>>>>>>> wrote: >>>>>>>>>> On Sat, 16 May 2020 09:29:56 +0900 >>>>>>>>>> Takashi Yano via Cygwin-developers >>>>>>>>>> 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) > I found this is a bug introduced in commit > 0365031ce1347600d854a23f30f1355745a1765c. > > I will submit a patch for this issue. > >> 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 > This behaviour is the same as cygwin 3.0.7. Pseudo console is not > activated for native GUI processes. OK, I understand this is consistent with my own proposal to apply pseudo console only for Windows command-line programs. On the other hand, fatal signal handling is another nuisance of running Windows programs from cygwin, so there was a benefit. Is it possible to activate the signal interworking without setting up a pseudo console? If not, is it maybe worth to set it up also for Windows GUI programs just for this purpose? (Modifying my proposal to trigger on any Windows program.) >> 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) > In this case, stdout is not a pty. So this is not a pty problem. > >> 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) > This is due to the disadvantage 3) I mentioned in the first post. > Disadvantage: > 3) The cygwin program which call console API directly does not work. Understood, I think this is an acceptable trade-off. >> using attached program sgr.java >> run program, check coloured output of middle characters >> ✓works (did not in 3.1.6) > This may work by chance. Escape sequences in native console apps > are supported only with ENABLE_VIRTUAL_TERMINAL_PROCESSING. So this seems to be enabled by the Java runtime. Would be nice if there were a Windows option (exe file property) to enforce the mode even for programs that do not actively invoke it. I've filed an issue (https://github.com/microsoft/terminal/issues/6973) to this aim. Kind regards, Thomas