From owner-freebsd-arch@FreeBSD.ORG Fri Feb 21 12:05:53 2014 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 517703A7; Fri, 21 Feb 2014 12:05:53 +0000 (UTC) Received: from mail-ve0-x22c.google.com (mail-ve0-x22c.google.com [IPv6:2607:f8b0:400c:c01::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F0E8B1532; Fri, 21 Feb 2014 12:05:52 +0000 (UTC) Received: by mail-ve0-f172.google.com with SMTP id jz11so1284668veb.31 for ; Fri, 21 Feb 2014 04:05:52 -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=DueIrPFTPvyiV3QkRdgFSdMZJI3aPCdfJBoovvgsK1U=; b=d8Wt/8mwL7UC61i0R/87dy4bvnCQ1uBFOxf32TytHNdQJ976U9/CHRww9Ki+ke3AXk rGILWOqcas8kl3flQnTfP7/2ilW1gGUINo/03sjXzxSxMstimLa0xN/lDrHitwpRFa8F vDqQfM4tk6Qa085gfeeCIHZHDYOWTUlbIKZI5usnomzLA32mTq6TfvZltc3NIb4l4NuT IuC2oHxdtSg4zXB7qj879fSN2eCr7TuLliNcjBZZ/SlFj9y6sjwpV7tWbiTJ3rx9bR/d Btmbg+9GwsNGDcdCIDBHVLqTL6SixdaDI8j6B1OGomdOb9SSqa/zoW6UFO/3fCVxWeFa LrTQ== MIME-Version: 1.0 X-Received: by 10.220.112.75 with SMTP id v11mr4533991vcp.74.1392984352088; Fri, 21 Feb 2014 04:05:52 -0800 (PST) Sender: edschouten@gmail.com Received: by 10.220.105.140 with HTTP; Fri, 21 Feb 2014 04:05:52 -0800 (PST) In-Reply-To: <5304A0CC.5000505@FreeBSD.org> References: <5304A0CC.5000505@FreeBSD.org> Date: Fri, 21 Feb 2014 13:05:52 +0100 X-Google-Sender-Auth: OQhDj2m-_xIuc0WJ1zE36G2vt0k Message-ID: Subject: Re: terminfo From: Ed Schouten To: Bryan Drewery Content-Type: text/plain; charset=UTF-8 Cc: arch@freebsd.org 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: Fri, 21 Feb 2014 12:05:53 -0000 Hi Bryan, On 19 February 2014 13:17, Bryan Drewery wrote: > Why do we not use terminfo? Our termcap is quite aged and missing a lot > of modern terminals/clients. It is true that our termcap is quite aged, but the fact is, once you add entries for a certain terminal, there's little need to update it after that. ncurses itself is not really a moving target. What kind of modern terminals/clients are missing? > Using terminfo would allow us to use the already well maintained database from ncurses. Is it just a matter of someone doing the work or are there other reasons? It's just a matter of someone doing the work. It would be nice if we ever made this change. On the other hand, I might have a radical point of view here: maybe we could consider taking the approach of sticking to termcap and installing /etc/termcap.small as the system's default termcap. Or maybe patch up our termcap routines to just hardcode the sequences. 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, 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 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. -- Ed Schouten