From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#30505: Starting console/terminal Unicode support Date: Wed, 21 Feb 2018 23:21:34 +0100 Message-ID: <87bmgic7bl.fsf_-_@gnu.org> References: <87vaevi2sk.fsf@gnu.org> <20180218114833.7d5e7848@scratchpost.org> <87r2phezzv.fsf@gnu.org> <20180219180849.3a509e80@scratchpost.org> <87d110g1l2.fsf@gnu.org> <20180219233553.31aeef1a@scratchpost.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:57358) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eocmq-000556-RU for bug-guix@gnu.org; Wed, 21 Feb 2018 17:24:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eocm2-0005Ps-UJ for bug-guix@gnu.org; Wed, 21 Feb 2018 17:22:52 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:47120) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eocm2-0005P0-Gx for bug-guix@gnu.org; Wed, 21 Feb 2018 17:22:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eocm2-00062a-5Y for bug-guix@gnu.org; Wed, 21 Feb 2018 17:22:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <20180219233553.31aeef1a@scratchpost.org> (Danny Milosavljevic's message of "Mon, 19 Feb 2018 23:35:53 +0100") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Danny Milosavljevic Cc: 30505@debbugs.gnu.org Hi Danny, Danny Milosavljevic skribis: > On Mon, 19 Feb 2018 21:35:05 +0100 > ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > >> > It was a bad idea to do the "\x1b%G" in the first place.=20=20 >>=20 >> Because it=E2=80=99s redundant with IUTF8? > > I meant because the Linux kernel does it already and it's better not to > have random multi-byte racy writes onto the tty while the mingetty > is starting up (and possibly buffering and pending half of another sequen= ce). That =E2=80=98unicode-start=E2=80=99 code run when the =E2=80=98console-fon= t-ttyN=E2=80=99 service is started, right after =E2=80=98term-ttyN=E2=80=99 (mingetty) is up. You=E2= =80=99d hope mingetty is really up and running once =E2=80=98term-ttyN=E2=80=99 is up, no? > As far as I understand it's not redundant to do both. > > According to src/Linux/linux-4.12-rc2/drivers/tty/vt/vt.c, the 'G' contro= ls > the conversion utf-8->unicode that happens before the virtual terminal > displays a corresponding character on the screen. > > On the other hand, the termios iutf8 is meant for the program running in = the session. OK, I see. > Say you have bash on vt1, then bash can check termios for the settings an= d find > out whether vt1 is UTF-8-capable (also has other settings like whether the > terminal already supports line editing etc - old-school terminals were qu= ite > cool; a friend of mine salvaged a real one ^^). > > Note that drivers/tty/vt/vt.c only copies ONE way, from the 'G' flag to t= he > termios (and that seldomly). > Makes sense since the programs shouldn't have a say in what the terminal = can do :) > > So I'd say guix services fiddling with termios is ... weird and the 'G' s= lightly > less weird. [...] >> This =E2=80=98unicode-start=E2=80=99 procedure is essentially a port of = the >> =E2=80=98unicode_start=E2=80=99 script from =E2=80=98kbd=E2=80=99. I su= ppose the justification is to >> make sure we=E2=80=99re using UTF-8 input regardless of what the kernel = defaults >> or command-line options are. > > Yeah, but it's asking for trouble. > > I just checked Linux 2.6.32.1, it defaults to utf8 (IUTF8 in termios, and= 'G'). > > I'd suggest to remove both. When we=E2=80=99re using the defaults, I understand both are unnecessary. = In other cases (custom kernel build with different defaults, different kernel command-line settings, etc.), we=E2=80=99d just get it wrong with th= ings breaking down the path, no? Also, FWIW, systemd=E2=80=99s vconsole-setup.c does exactly that: https://github.com/systemd/systemd/blob/master/src/vconsole/vconsole-setu= p.c#L94 And again that corresponds to the =E2=80=98unicode_start=E2=80=99 script. Thoughts? Ludo=E2=80=99.