bug-ncurses
[Top][All Lists]
Advanced

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

Re: Detecting if a terminal can do reverse video


From: Thomas Dickey
Subject: Re: Detecting if a terminal can do reverse video
Date: Thu, 16 Nov 2006 06:05:45 -0500 (EST)

On Thu, 16 Nov 2006, Mike Aubury wrote:

Or more to the point - that it can't!

Is there any easy way to detect this ?

Background..
I need to add some emphasis to the "current" menu option which I'm doing by
making it in REVERSE video, but some terminals can't do reverse, so I'm
supposed to put "[" and "]" around the option. I've got the code working with
an environment variable, but it'd be nice if I could just detect it...

You can check if the terminfo description says so - though of course that
may be unreliable.  By making a module include <term.h>, you can test if
enter_reverse_mode is a nonnull string. Also (sgr), set_attributes may claim that it implements it (though the check is more obscure, and a lot of people use cut/paste on sgr where rev might actually get some scrutiny).

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net




reply via email to

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