[systemd-devel] Antw: [EXT] Re: vt220 default for serial console still relevant?

Ulrich Windl Ulrich.Windl at rz.uni-regensburg.de
Thu Jul 16 06:29:53 UTC 2020


>>> Daan De Meyer <daan.j.demeyer at gmail.com> schrieb am 15.07.2020 um 20:39 in
Nachricht
<CAO8sHc=gMAXC3-dhtQMYNnZF2mHjoQ10kCbwWNUzLLo6=c_wpA at mail.gmail.com>:
>>  Well, --color means you request color no matter what, so this is not
> surprising.
> 
> I actually only got color because TERM was set to xterm-256color. ls won't
> output color if TERM is set to vt220. It checks against a hardcoded list of
> terminals to determine whether it'll output colors or not. See
> https://github.com/coreutils/coreutils/blob/6a3d2883fed853ee0107947702009106 
> 8074e12d/src/dircolors.hin
> 
>> Again, I'd be happy to switch to a different default for serial
>> terminals if we can find a reasonable one that is available widely in
>> termcap, that does color, and is a subset of both TERM=linux and
>> TERM=xterm.
> 
> So the vt220 was the first of the vt200 series and was a black and white
> terminal. The vt241 was the model in that series that added colors. Problem
> is that the vt241 is not in my terminfo database. The other problem is that

If you have technical documentation for the terminal, it should be rather easy to add corresponding entries.
Having such a terminal for testing wouldn't be a bad idea, however.
Minimalistically you could add an alias to an existing terminal entry, too.
Basically I think you should not set a terminal type to some specific when the terminal you have is different.

> vt241 is not actually in ls's list of terminals that it should output
> colors for so using that one is probably not a good idea. What would work
> is vt100 since for some weird reason that one is in ls's list of terminals
> with colors even though
> https://invisible-island.net/ncurses/ncurses.faq.html#vt100_color 
> explicitly says the vt100 does not support colors. Switching to vt100 would

That is true: vt100 was monochrome.

> break pageup/pagedown however so that's not really an option either. I
> didn't find any other alternatives that seemed viable.

I also think vt100 had no cursor keys and related. Later models like vt220 probably had.

> 
> I suppose I could make a coreutils PR that adds vt220 to the list of
> terminals that support colors. vt100 is already in there and it doesn't

But if the vt220 was monochrome, that does not make any sense at all!

> support colors so who knows maybe they'll add vt220 as well for the
> pragmatic reason that systemd can't use anything else but it would still be
> nice to have colors out of the box. I don't think that's likely to be
> accepted though and it only fixes ls and not programs like ncurses which
> adhere to whatever's in the terminfo database.
> 
> For now, the pragmatic solution for my use case (mkosi test VMs that only I
> will ever use) is to simply make it easy to override TERM in the VM to
> whatever TERM is in my host terminal via mkosi.
> 
> Daan
> 
> 
> 
> 
> On Wed, 15 Jul 2020 at 17:09, Lennart Poettering <lennart at poettering.net>
> wrote:
> 
>> On Di, 14.07.20 22:15, Daan De Meyer (daan.j.demeyer at gmail.com) wrote:
>>
>> > > About your other comments, systemd sits in user space and can query
>> > (depend
>> > > upon) terminfo.  Then, it should be able to support "whatever" terminfo
>> > has
>> > > defined.... which could include custom terminals by the way that an end
>> > user has
>> > > added.  And while all of that sounds incredibly ancient/old, I was on a
>> > project
>> > > post 2000 that had to do exactly that (of course, even that might sound
>> > too old).
>> >
>> > Interestingly enough, systemd's colors work even when TERM is set to
>> vt220,
>> > probably because it uses ansi escape codes regardless of the TERM
>> setting.
>> > I think there's probably lots of applications doing this except for ls in
>> > coreutils which has an explicit list of terminals with color support
>> > encoded in the dircolors configuration file.  If TERM isn't one of those,
>> > you don't get colors. There's probably others that do this as well. I
>> don't
>> > think changing the default in systemd is a good idea since it might break
>> > other stuff. I'm going to submit a mkosi PR instead that adds an option
>> > that overrides serial-getty at ttyS0 with whatever terminal the user wants.
>> > Colors won't work out of the box but at least it shouldn't be too hard to
>> > find out how to get them to work when using mkosi.
>>
>> Again, I'd be happy to switch to a different default for serial
>> terminals if we can find a reasonable one that is available widely in
>> termcap, that does color, and is a subset of both TERM=linux and
>> TERM=xterm.
>>
>> Lennart
>>
>> --
>> Lennart Poettering, Berlin
>>





More information about the systemd-devel mailing list