From: ludo@gnu.org (Ludovic Courtès)
To: Danny Milosavljevic <dannym@scratchpost.org>
Cc: 30505@debbugs.gnu.org
Subject: bug#30505: Starting console/terminal Unicode support
Date: Wed, 21 Feb 2018 23:21:34 +0100 [thread overview]
Message-ID: <87bmgic7bl.fsf_-_@gnu.org> (raw)
In-Reply-To: <20180219233553.31aeef1a@scratchpost.org> (Danny Milosavljevic's message of "Mon, 19 Feb 2018 23:35:53 +0100")
Hi Danny,
Danny Milosavljevic <dannym@scratchpost.org> skribis:
> On Mon, 19 Feb 2018 21:35:05 +0100
> ludo@gnu.org (Ludovic Courtès) wrote:
>
>> > It was a bad idea to do the "\x1b%G" in the first place.
>>
>> Because it’s 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 sequence).
That ‘unicode-start’ code run when the ‘console-font-ttyN’ service is
started, right after ‘term-ttyN’ (mingetty) is up. You’d hope mingetty
is really up and running once ‘term-ttyN’ 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' controls
> 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 and 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 quite
> 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 the
> 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' slightly
> less weird.
[...]
>> This ‘unicode-start’ procedure is essentially a port of the
>> ‘unicode_start’ script from ‘kbd’. I suppose the justification is to
>> make sure we’re 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’re using the defaults, I understand both are unnecessary. In
other cases (custom kernel build with different defaults, different
kernel command-line settings, etc.), we’d just get it wrong with things
breaking down the path, no?
Also, FWIW, systemd’s vconsole-setup.c does exactly that:
https://github.com/systemd/systemd/blob/master/src/vconsole/vconsole-setup.c#L94
And again that corresponds to the ‘unicode_start’ script.
Thoughts?
Ludo’.
next prev parent reply other threads:[~2018-02-21 22:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-18 0:01 bug#30505: marionette/virtio-console issues lead to test failures Ludovic Courtès
2018-02-18 10:48 ` Danny Milosavljevic
2018-02-19 15:54 ` Ludovic Courtès
2018-02-19 17:08 ` Danny Milosavljevic
2018-02-19 20:35 ` Ludovic Courtès
2018-02-19 22:35 ` Danny Milosavljevic
2018-02-21 22:21 ` Ludovic Courtès [this message]
2018-02-21 23:01 ` bug#30505: Starting console/terminal Unicode support Danny Milosavljevic
2018-02-23 21:41 ` Ludovic Courtès
2018-02-25 12:31 ` Danny Milosavljevic
2018-02-25 12:57 ` Danny Milosavljevic
2018-02-26 17:09 ` Ludovic Courtès
2018-02-26 22:23 ` Danny Milosavljevic
2018-02-27 9:25 ` Ludovic Courtès
2018-03-15 10:41 ` Ludovic Courtès
2018-02-19 21:53 ` bug#30505: marionette/virtio-console issues lead to test failures Ludovic Courtès
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=87bmgic7bl.fsf_-_@gnu.org \
--to=ludo@gnu.org \
--cc=30505@debbugs.gnu.org \
--cc=dannym@scratchpost.org \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.