From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5860 invoked by alias); 14 Feb 2017 19:40:56 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 5846 invoked by uid 89); 14 Feb 2017 19:40:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=enhanced, pty, concept, terminals X-HELO: mout.kundenserver.de Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (212.227.17.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 14 Feb 2017 19:40:53 +0000 Received: from [192.168.178.45] ([95.91.244.74]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.183]) with ESMTPSA (Nemesis) id 0MRijR-1coP8d1ja5-00SvVn for ; Tue, 14 Feb 2017 20:40:50 +0100 Subject: Re: [ANNOUNCEMENT] Updated: dash-0.5.8-3 To: cygwin@cygwin.com References: <58893f48.0850ca0a.6c5d.5fde@mx.google.com> <81b5af354b7a3925ff0a68dcc063265f@smtp-cloud6.xs4all.net> <20170131100402.GB29504@calimero.vinschen.de> <20170131131616.GC29504@calimero.vinschen.de> <40c92f1e987a9162742766816abb4a03@smtp-cloud2.xs4all.net> <20170131153245.GA8905@calimero.vinschen.de> <09c7b42a-7b8d-52b7-ce18-4e681eb51f05@towo.net> <20170214084537.GD25846@calimero.vinschen.de> From: Thomas Wolff Message-ID: <09253e2d-af27-ddca-2b49-b65460440f69@towo.net> Date: Tue, 14 Feb 2017 19:40:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20170214084537.GD25846@calimero.vinschen.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-UI-Out-Filterresults: notjunk:1;V01:K0:1h0SiRxs8+k=:IuKcR6Imz9lnj74VuGLGEh Ee0uVbApG3sWjREknnjM81qEFtzPRV7Bs3R2FgqPuibJ+NmeVUmc+cZ5rV7GCrM0UVjFkHJ6Y E/0CuMt4Eb2UiCN9i4IJJRrZoVhbjF+YgtRIqNV3juK7iYYx6F/+hwtIlS0EWU5i2qbBaNQjU 52GROorrBUw9/vQYtWIN8sqxdBBgKPk7cUYcgAM+xB16/cpi+XhRtR3DhuoqAAK6Kno5GA/EZ wlh99+x3DOu8oE1XIxee1dqICb3/CtwoUIFTw0cenT5GKYyKqUkuNQVaRVLEeSiPN5L56AFUO ehkolH8v3cQErLHAvhp2VQZKojlZrBka/cVMIIvLb5aRjkoL4V8srwCgQu9xQ0McHzFFaWS/Q Dl6NiF2tylGr+GMRkUY++VPB+wQpQQpVUlB/oYbpoFk+RSPzXo3x6YnEj6C2/u2NiDh5IIYrR PTnkHeVEPqfRdKLj4hWhy2EJYyW3twWbKRSZZNipOxb/aVklBrwvdx8Rket3Qf8qUJLmssZUW UmupqP5BrdrUcT3UCNARZKwTtjNKCzjJOP80QcwLvmXHr3ESOM7OGEYmCHbq/fCqsdo6/N6B7 UV0ZHMyWJekxElT3pYkXUiRmj/3QEYufDAchG2qbUEYdIU6OS5rVYHL9xlxI80M6+sX54jR1Q kQDQ84IPbzOVja0RXZK0M/kzV9qV4tEIUdjt8uDNH/6MXbrFbgQ4ndMlRSEx64Gt6S4Mh31AT i81MLzx2zQQiapsv X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg00191.txt.bz2 Am 14.02.2017 um 09:45 schrieb Corinna Vinschen: > On Feb 13 23:03, Thomas Wolff wrote: >> Am 31.01.2017 um 16:32 schrieb Corinna Vinschen: >>> On Jan 31 16:01, Houder wrote: >>>> On Tue, 31 Jan 2017 14:16:16, Corinna Vinschen wrote: >>>> [snip] >>>>> Ok, here's what happens on Linux: The termios code support a flag >>>>> IUTF8. This flag determines if the termios code checks for UTF8 >>>>> characters in the input when performing an ERASE. It checks if the >>>>> IUTF8 flag is set and if so, it checks in a loop if the just erased byte >>>>> is a UTF-8 continuation character. If so, it erases another byte. >>>> Agreed. One byte or more, depending on the "character" ... (which is >>>> not a problem in case of UTF-8 encoding -- continuation bit). >>>> >>>> Of course, the terminal driver must receive the characters encoded in UTF-8. >>>> >>>> ... >>> ... It's the termios implementation >>> inside Cygwin. I created a patch introducing the IUTF8 flag as on Linux >>> as well as a code snippet trying to remove entire utf-8 characters from >>> the input if the IUTF8 flag is set. And it's set now by default since >>> we default to UTF-8 anyway. >>> >>> Thomas, you may want to check for the IUTF8 flag in upcoming mintty >>> versions and unset it if character set configured in the mintty options >>> dialog is != UTF-8. >> So the flag is always set initially? Also on Linux? Does it (on Linux) also >> have an effect for non-UTF-8 multibyte encodings? > Yes, yes, and yes. > >> And cannot the Cygwin DLL set the flag to match the locale setting when it >> was invoked? >> >> I can (and will if appropriate) handle the flag in mintty as needed, but >> what if someone calls LC_ALL=.other_encoding dash later within the terminal >> session? I guess the more consistent solution would be to handle this in the > No. We're talking about a function in the master side of the tty, while > the applications started in the terminal are on the slave side. I am not familiar with the concept of setting termios properties on either the master or slave side of a pty. I've only ever set them in the client application, including my tests about IUTF8 which worked. Would setting on the master side imply it's set for the clients implicitly, and can it be changed later, e.g. when mintty character encoding is being changed from the Options dialog? And you say the function of erasing characters on BS is in the master side? To be honest, this confuses me. I thought it's a client function, like readline() would perform if used (apparently not by dash), which is kind of an enhanced version of the tty cooked mode and used to work even without the new flag, right? > iutf8 is set in Linux by default and by most terminal applications ionly > reset if the LC_CTYPE setting in the environment of the terminal > application is not set to the utf8 codeset. This is determined at > terminal startup, not by the inferior processes runnin in the terminal. > The applications still can set iutf8 via termios control (or stty(1)). Will you patch stty as well to address the new flag? > For mintty I just thought it might be helpful to honor the character set > setting in its options and to default to iutf8 if it's not set. Sure, but it would be better to find a solution that implicitly works in all terminals. Isn't it possible to handle this in forkpty()/openpty()? ------ Thomas -- 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