[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tput(1) -T without a tty

From: Thomas Dickey
Subject: Re: tput(1) -T without a tty
Date: Wed, 4 Oct 2017 20:59:02 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Oct 05, 2017 at 12:28:09AM +0300, Lauri Tirkkonen wrote:
> Hi,
> as documented in the manual page, tput(1) no longer works without a
> tty:
>     Until changes made after ncurses 6.0, tput did not modify terminal
>     modes.  tput now uses a similar scheme, using functions shared with
>     tset (and ultimately based on the 4.4BSD tset).  If it is not able
>     to open a terminal, e.g., when running in cron, tput will return an
>     error.
> I'm having a little trouble understanding why this is also true if using
> the -T option. There's at least one (admittedly quite archaic) piece of
> software that uses -T to gather information about some predefined
> terminals for use in an environment where it cannot rely on ncurses:
> namely, the "tigen" script during illumos build queries tput for data to
> be used in the kernel debugger kmdb. See
> https://github.com/illumos/illumos-gate/blob/master/usr/src/cmd/mdb/tools/scripts/tigen.sh#L32
> But using ncurses tput, which requires a tty, the illumos build cannot
> be run from cron. I've thrown together the following quick patch to
> avoid opening a tty if -T is given; is this a reasonable use case?

hmm - rather than special-case "-T", why not a new option to tell it
to not attempt to modify the terminal modes?

Offhand, neither tset/tput has a "-f" (force) option...

Solaris tput doesn't special-case "-T", it simply ignores the failure
to update the terminal modes.

Thomas E. Dickey <address@hidden>

Attachment: signature.asc
Description: Digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]