From nobody Thu Feb 23 20:14:16 2023 X-Original-To: questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN44P3ypZz3shwP for ; Thu, 23 Feb 2023 20:14:29 +0000 (UTC) (envelope-from kh@panix.com) Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PN44N49mtz4Hlc for ; Thu, 23 Feb 2023 20:14:28 +0000 (UTC) (envelope-from kh@panix.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=panix.com header.s=panix header.b=Claa84HH; spf=pass (mx1.freebsd.org: domain of kh@panix.com designates 166.84.1.89 as permitted sender) smtp.mailfrom=kh@panix.com; dmarc=pass (policy=none) header.from=panix.com Received: from rain.cave (unknown [73.142.21.0]) by mailbackend.panix.com (Postfix) with ESMTPSA id 4PN44F6V8sz3pLX for ; Thu, 23 Feb 2023 15:14:21 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=panix.com; s=panix; t=1677183262; bh=YjEArtnXKLYRn97rQTksg8HqXiHA6nanQUUVXZx8c+k=; h=Date:From:To:Subject:References:In-Reply-To; b=Claa84HHx+StnDw0jvdcU+FUoSI6e6225e+5sTgYWSFAQnHSzT6hfhUksP/klYCrr RGk6pz7dbgRvxz/q5+WUW2XxL58+z0MoaPNOA3x/41WI2UyYEGT/AbD/39MsEO5jxQ SGMhc+dNM5f3R7eh7nuTpdTEXBag/uXIPdh8u8FI= Date: Thu, 23 Feb 2023 15:14:16 -0500 From: Kurt Hackenberg To: questions@freebsd.org Subject: Re: Cursing the tput utility - the penguin strikes again Message-ID: References: <974a81c2-a92d-7f94-5f96-869bddfe21f3@fjl.co.uk> List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <974a81c2-a92d-7f94-5f96-869bddfe21f3@fjl.co.uk> User-Agent: Mutt/2.2.9 (2022-11-12) X-Spamd-Result: default: False [-3.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.87)[-0.866]; DMARC_POLICY_ALLOW(-0.50)[panix.com,none]; R_DKIM_ALLOW(-0.20)[panix.com:s=panix]; R_SPF_ALLOW(-0.20)[+ip4:166.84.1.64/26]; MIME_GOOD(-0.10)[text/plain]; RWL_MAILSPIKE_GOOD(-0.10)[166.84.1.89:from]; RCVD_VIA_SMTP_AUTH(0.00)[]; MLMMJ_DEST(0.00)[questions@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:2033, ipnet:166.84.0.0/16, country:US]; MIME_TRACE(0.00)[0:+]; DKIM_TRACE(0.00)[panix.com:+]; PREVIOUSLY_DELIVERED(0.00)[questions@freebsd.org]; RCVD_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; FROM_HAS_DN(0.00)[]; TO_DN_NONE(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4PN44N49mtz4Hlc X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N On Thu, Feb 23, 2023 at 04:45:21PM +0000, Frank Leonhardt wrote: >So there's a tput utility for controlling the terminal in BSD. ... >Well use the tcap utility on non-BSD platforms and it suddenly doesn't >work. It turns out that the penguinistas thought using the "Cap Name" >instead of the "TCap Code" was a good idea. Some of the codes are the >same, some are not. In fact most are not. The trouble is those are two different mechanisms, based on two different file formats, that do the same thing. The two file formats are "termcap" and "terminfo", both from the default names of the system files that use them. Manual section 5 has pages about both. They're similar, but different enough to be incompatible. The "TCap codes" are the names used in termcap format; the "Capnames" are the names used in terminfo format. (A "cap" is a terminal "capability".) I think termcap came first, and then somebody invented terminfo as an improvement or a reimplementation of the same idea. I think termcap came from Berkeley Unix -- maybe invented for vi -- so FreeBSD more or less stayed with it. Maybe terminfo came from Bell Labs; I think Linux prefers it. This is pointlessly incompatible, the result of haphazard evolution, and kind of a mess. It's all about 40 years old. The library functions that use those terminal descriptions were in the library "curses" (from "cursor"), long ago superseded by "ncurses" (new curses). Probably the program tput uses the library ncurses. You might want to look at that library; maybe there's a compatibility layer. Or, as Daniel Tameling suggested, maybe there are two different version of ncurses.