From owner-freebsd-arch@FreeBSD.ORG Sun Feb 23 13:49:27 2014 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E7A156B; Sun, 23 Feb 2014 13:49:27 +0000 (UTC) Received: from mail-vc0-x22e.google.com (mail-vc0-x22e.google.com [IPv6:2607:f8b0:400c:c03::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C7AF01DD2; Sun, 23 Feb 2014 13:49:26 +0000 (UTC) Received: by mail-vc0-f174.google.com with SMTP id im17so4779048vcb.5 for ; Sun, 23 Feb 2014 05:49:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=AnFC+WBnkqGztrTZrWVmZjgYfGCczsXDcJNVDgKY5PU=; b=GUugPbl5M7Njftbac0JekmHdtqNYcLtfgSJvXEOU0yVp6oMa4DmK2ZSzqQU6DnH3VE jeusS0U1waSut4BIYjH1CG6jsD/7cU0XHqIQH4v/EyyZZcufMzBYYb0FrPORbu3AY6up /bmn8YmrPYLFQY+6kz0MV+S6CSt5F68E6eMjtFxKHAMzIiFQAh5NRqZvGFBi6aQ8B4fc MmChpyVk+m1cD9P8dKiYLpCCCkQbRZ7qrpRO64TZjVM+LKBbWMmNpUtqnHsB2H2woqxW wzlvnezD9T0Sv4al8HUNhkr98PXBZmgESI4mYI9geVEWKYMHf7WrsbsmbZG733PYnlFr dtfg== MIME-Version: 1.0 X-Received: by 10.220.67.18 with SMTP id p18mr9942119vci.14.1393163365859; Sun, 23 Feb 2014 05:49:25 -0800 (PST) Sender: edschouten@gmail.com Received: by 10.220.105.140 with HTTP; Sun, 23 Feb 2014 05:49:25 -0800 (PST) In-Reply-To: <20140223115939.GB4084@aerie.jexium-island.net> References: <5304A0CC.5000505@FreeBSD.org> <20140223115939.GB4084@aerie.jexium-island.net> Date: Sun, 23 Feb 2014 14:49:25 +0100 X-Google-Sender-Auth: a5uZkc1bDxu0dtwaZqpjTJJTGNI Message-ID: Subject: Re: terminfo From: Ed Schouten To: dickey@his.com Content-Type: text/plain; charset=UTF-8 Cc: arch@freebsd.org, Bryan Drewery X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 13:49:27 -0000 Thomas, On 23 February 2014 12:59, Thomas Dickey wrote: >> I won't deny that termcap was really useful at one point in time, but >> let's be honest: the variety of terminals out there has massively >> dropped over time. Terminal emulation has become a solved problem. As >> of FreeBSD 9, syscons supports all the sequences described in >> xterm-256color, though it isn't able to print more than 8 colours, > > I'm inclined to disagree with that. > > Here's a working entry for the console, along with notes: > > http://invisible-island.net/ncurses/terminfo.src.html#tic-teken > > (though I see that I overlooked adding the note which I made for wsvt25, > that none of the xterm-specific items is supported). > > Counting differences using infocmp: > versus cons25 (37 lines) > versus xterm-new (120 lines) > > One of the differences against cons25 is partial, as noted in my comments > on acsc - there's no corresponding adjustment to make against xterm. This terminfo entry is incorrect. It will make ACS work on a standard setup where the user has the BIOS CP437 font loaded, but will break horribly if a user uses a different character set, like ISO-8859-1. There is a reason why syscons displays ASCII characters for ACS box drawing, namely that there is no guarantee that the actual font loaded into the graphics card has any ACS characters to begin with. >> which is why we use TERM=xterm. Tools like screen, tmux, etc., they >> use a different TERM type, but this is mainly used to detect whether >> the process is running inside of screen or tmux. It does not strongly >> affect the kinds of sequences that are being emitted. They work >> perfectly fine if you just set TERM to xterm or xterm-256color. >> >> I suspect the following logic would be sufficient for at least 99.5% >> of our users: >> >> if $TERM contains 256 >> use xterm-256color >> else >> use xterm > > I didn't see any 256-color support in testing this configuration. > It does _something_, but would tend to disappoint users. > > ftp://invisible-island.net/temp/teken-88colors.png > ftp://invisible-island.net/temp/teken-256colors.png > > (screenshots made using VMware Fusion with FreeBSD 10 - ymmv) As I mentioned before, teken supports 256 colours internally, but this is sampled down to 8 different colours later on. This is due to the fact that syscons only reserves 1 byte per cell to keep track of display attributes, which is not sufficient to keep track of 256 foreground colours, 256 background colours and bold, blink, etc. >> It's a shame I am so short on time nowadays, but I think it would make >> so much sense to just come up with some kind of document that >> standardizes the intersection of the features supported by most common >> terminal emulators and get it rubber stamped by the maintainers of >> various terminal emulators. If it turns out some kind of terminal >> emulator does something in a non-standard way, we can just slap this >> document in the author's face. That would not only benefit FreeBSD, >> but also most of the other flavours of UNIX. >> >> $TERM should die. > > certainly not while there are such large differences among the implementations. > > :-) And I think that these differences only exist, because -- don't take this as a personal insult, please read on -- the maintainer of terminfo/ncurses/vttest has done little to nothing to introduce any convergence of implementations over time. I think the comment you've added above the termcap entry and this email demonstrate this. Because realistically speaking: - Who cares about VT52 support? Those things are from the Viking Age. - Who cares about double-width characters? I don't know a single program that uses this. In the worst case, you can just use fullwidth CJK for certain characters. - Who cares about send/receive mode? - Who cares about 88 colour support? Just use 256 colours. - Who cares about ACS? Unicode already has those characters. There are so many legacy features out there, that nobody actually *knows* how terminals should behave anymore. Also combined with the fact that the de facto reference implementation of terminal emulation (i.e., xterm) cannot easily be decoupled from X11, people just make stuff up. People are nowadays only interested in having a 16 or 256 colour, UTF-8 enabled terminal. It would be so incredibly easy for you as the maintainer of terminfo to say: "Here's an ideal terminfo entry. It's compact, easy to implement, etc. This is how I want terminals to behave. And this menu in vttest can be used to easily test conformance." Then you just file bugs against the authors of commonly used terminal emulators and 3-5 years later, the ecosystem has converged. Done. As I mentioned before, my spare time is limited nowadays, but if you would be interested in doing something like that, I would be more than interested to get this sorted out on FreeBSD's side. -- Ed Schouten