From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7169 invoked by alias); 3 Apr 2019 07:55:40 -0000 Mailing-List: contact cygwin-developers-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner@cygwin.com Mail-Followup-To: cygwin-developers@cygwin.com Received: (qmail 7159 invoked by uid 89); 3 Apr 2019 07:55:39 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=screen, Youll, You'll X-HELO: mout.kundenserver.de Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (212.227.126.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 03 Apr 2019 07:55:38 +0000 Received: from [192.168.178.45] ([95.91.242.222]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MY60L-1hQ5JR2H9R-00YO5q; Wed, 03 Apr 2019 09:55:32 +0200 Subject: Re: Pseudo console support in PTY To: cygwin-developers@cygwin.com, Takashi Yano References: <20190330220804.a3be5fa8c4d5569464309d66@nifty.ne.jp> <20190402110248.GP3337@calimero.vinschen.de> <20190402175055.GQ3337@calimero.vinschen.de> <20190403072758.GR3337@calimero.vinschen.de> From: Thomas Wolff Message-ID: <02bf16d7-a4cd-61f5-6434-1cbf474cb0bf@towo.net> Date: Wed, 03 Apr 2019 07:55:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190403072758.GR3337@calimero.vinschen.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2019-04/txt/msg00005.txt.bz2 Am 03.04.2019 um 09:27 schrieb Corinna Vinschen: > On Apr 3 09:18, Thomas Wolff wrote: >> Am 02.04.2019 um 19:50 schrieb Corinna Vinschen: >>> On Apr 2 19:16, Thomas Wolff wrote: >>>> Am 02.04.2019 um 13:02 schrieb Corinna Vinschen: >>>>> Hi Takashi, >>>>> >>>>> On Mar 30 22:08, Takashi Yano wrote: >>>>>> Patch 0003: Support pseudo console in PTY. With this patch, >>>>>> native console applications can work in PTY such as mintty, >>>>>> ssh, gnu screen or tmux. >>>> I've now tried your patched binaries on two systems. On one they don't run, >>>> on the other I saw no noticeable effect, particularly no impact on the >>>> pty/console interoperability... >>> Try starting cmd from your shell in mintty and do some native stuff. >> I've now self-compiled cygwin dll on a third system and can run a cygwin >> console. >> But the build process did not generate the cygwin-console-helper, maybe >> that's the reason why mintty does not start? Can you give a hint that enables me to test the patch? >>> You'll notice two differences: >>> >>> - cmd history works >> In the cygwin console, it does not, echos the cursor-up escape sequence > Oh, right, ... > >> instead. See my previous comment that I think ConPTY should only be applied >> if running at a pty. (And for other reasons only when starting a non-cygwin >> app.) > but you got that wrong. The conpty stuff *is* only applied for ptys. So cygwin running as cygwin console still sets up a pty? Anyway, what I mean it's (assumedly) not needed in a cygwin console, which I detected in my previous winpty injection patch by !strncmp (ttyname (0), "/dev/pty", 8). > The above appears to be a fallout of the console changes to support > the Windows console changes to emulate an xterm-256color, > https://sourceware.org/git/?p=newlib-cygwin.git;a=commitdiff;h=bd627864ab41 > > Takashi, can you take a look? > >>> - dir /p will actually page >> Does it also translate the character set? >> Test case, when running in a German UI Windows: >> xcopy >> echoes either of >> Unzul�ssige Parameteranzahl >> Unzulässige Parameteranzahl > I'm only running English systems, so I don't know. Is that in a console or in mintty? That's in mintty. (In a cygwin console, output is fine already as the Windows output API somehow seems to go directly to it.) You might have the same test effect with a small program like: #include #include void main() {   wchar_t * s = u"bäh 3€\n";   DWORD written;   HANDLE con = GetStdHandle(STD_OUTPUT_HANDLE);   WriteConsoleW(con, s, wcslen(s), &written, 0);   SetConsoleTextAttribute(con, FOREGROUND_RED);   WriteConsoleW(con, s, wcslen(s), &written, 0); } Further test cases: - raw keyboard input - signals, ^C in cmd... Thomas