public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Thomas Wolff <towo@towo.net>
To: cygwin@cygwin.com
Subject: Re: [ANNOUNCEMENT] Updated: dash-0.5.8-3
Date: Tue, 14 Feb 2017 19:40:00 -0000	[thread overview]
Message-ID: <09253e2d-af27-ddca-2b49-b65460440f69@towo.net> (raw)
In-Reply-To: <20170214084537.GD25846@calimero.vinschen.de>

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

  reply	other threads:[~2017-02-14 19:40 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-27 23:40 Eric Blake (cygwin)
2017-01-24 15:58 ` Houder
2017-01-25  1:28   ` Steven Penny
2017-01-25 13:37     ` Houder
2017-01-25 20:31       ` cyg Simple
2017-01-28 14:36         ` Houder
2017-01-26  0:14       ` Steven Penny
2017-01-28 13:44         ` Houder
2017-01-31 10:04           ` Corinna Vinschen
2017-01-31 13:16             ` Corinna Vinschen
2017-01-31 15:02               ` Houder
2017-01-31 15:33                 ` Corinna Vinschen
2017-01-31 15:42                   ` Eric Blake
2017-02-01  8:46                     ` Houder
2017-01-31 17:54                   ` Houder
2017-02-01  9:17                     ` Corinna Vinschen
2017-02-13 22:03                   ` Thomas Wolff
2017-02-14  8:45                     ` Corinna Vinschen
2017-02-14 19:40                       ` Thomas Wolff [this message]
2017-02-14 19:56                         ` Eric Blake
2017-02-14 20:29                           ` Thomas Wolff
2017-02-14 20:35                             ` Thomas Wolff
2017-02-15 22:19                               ` Thomas Wolff
2017-02-16 12:49                                 ` Corinna Vinschen
2017-02-16 20:32                                   ` Thomas Wolff
2017-02-17  7:36                                     ` Thomas Wolff
2017-02-17  9:43                                       ` Corinna Vinschen
2017-02-17 22:30                                         ` Thomas Wolff
2017-02-18 22:46                                           ` Thomas Wolff
2017-02-20  9:11                                             ` Corinna Vinschen
2017-02-20 21:08                                               ` Thomas Wolff
2017-02-20  9:07                                           ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=09253e2d-af27-ddca-2b49-b65460440f69@towo.net \
    --to=towo@towo.net \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).