Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Feb 2023 21:20:24 +0000
From:      Frank Leonhardt <freebsd-doc@fjl.co.uk>
To:        questions@freebsd.org
Subject:   Re: Cursing the tput utility - the penguin strikes again
Message-ID:  <809607b3-4ffb-6a34-9715-870481c4db45@fjl.co.uk>
In-Reply-To: <Y/ewkOQgK4K2K8Ne@mail.gmail.com>
References:  <974a81c2-a92d-7f94-5f96-869bddfe21f3@fjl.co.uk> <Y/ewkOQgK4K2K8Ne@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 23/02/2023 18:29, Daniel Tameling wrote:
> 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. It takes
>> "attributes" and arguments and outputs whatever control codes are 
>> needed to
>> make the terminal do what you need in a portable way (switch to bold, 
>> move
>> the cursor, clear to EOL or whatever). It doesn't matter if you're 
>> using an
>> VT52 terminal or xterm - tput does the translation.
>>
>> snip
>> So my question is, assuming one wants one's scripts to be compatible with
>> Linux, what's the best way of going about it? Is there some new
>> platform-independent way of doing this I'm too old to know about, or 
>> do you
>> really have to write shell scripts to cope with both by defining the 
>> code to
>> use up front based on the output of uname?
>>
>>
>> Did you try using the tput from devel/ncurses instead? I once ran into
>> a similar problem and if I remember correctly that one works with the
>> same options as on Linux because it's the one installed there. And it
>> is frequently already installed as a dependency; the problem is just
>> that the FreeBSD tput is earlier in PATH.

Thanks - I didn't know about that, and it's good to know.

It's not the solution I wanted as for compatibility I'm sticking with 
the base system. I think the "problem" is that BSD is using termcap 
definitions whereas Linux us using terminfo, which is logical as it's 
newer, but wrong!

Regards, Frank.






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?809607b3-4ffb-6a34-9715-870481c4db45>