ncurses has_colors() returns FALSE

ncurses has_colors() returns FALSE

Post by Fred Procto » Thu, 13 Aug 1998 04:00:00



I'm running an xterm in which "ls --color" shows nice colors for all the
file types, but my ncurses code returns FALSE when I call has_colors().
What do I need to do to get colors to work? Code snippet at end.

Thanks.

--Fred

#include <stdio.h>
#include <curses.h>

int main()
{
  int retval;

  initscr();
  cbreak();
  noecho();
  nonl();
  intrflush(stdscr, FALSE);
  keypad(stdscr, TRUE);

  start_color();

  if (FALSE == has_colors())
    {
      retval = -1;
    }
  else
    {
      retval = 0;
    }

  endwin();

  if (retval == -1)
    {
      printf("no colors\n");
    }
  else
    {
      printf("has colors\n");
    }

  return retval;

Quote:}

 
 
 

ncurses has_colors() returns FALSE

Post by Neil Cher » Thu, 13 Aug 1998 04:00:00


On Wed, 12 Aug 1998 16:27:12 -0400, Fred Proctor


>I'm running an xterm in which "ls --color" shows nice colors for all the
>file types, but my ncurses code returns FALSE when I call has_colors().
>What do I need to do to get colors to work? Code snippet at end.

I'm usint rxvt and I got the same thing, but under a regular vty I get
has_color. Sounds like you either need to have a better term lib (or
descriptor) or need some command line option. You could alwats try the
color xterm.

--


 
 
 

ncurses has_colors() returns FALSE

Post by T.E.Dicke » Fri, 14 Aug 1998 04:00:00



> On Wed, 12 Aug 1998 16:27:12 -0400, Fred Proctor

>>I'm running an xterm in which "ls --color" shows nice colors for all the
>>file types, but my ncurses code returns FALSE when I call has_colors().
>>What do I need to do to get colors to work? Code snippet at end.
> I'm usint rxvt and I got the same thing, but under a regular vty I get
> has_color. Sounds like you either need to have a better term lib (or
> descriptor) or need some command line option. You could alwats try the
> color xterm.

it's an faq (overlapping) wrt your $TERM variable:

The current version of ncurses is 4.2
There's an faq at
        http://www.veryComputer.com/
.
The XFree86 3.3.2 xterm supports ANSI color and VT220 emulation
There's an faq at
        http://www.veryComputer.com/
        ftp://ftp.clark.net/pub/dickey/xterm

--
Thomas E.*ey

http://www.veryComputer.com/

 
 
 

ncurses has_colors() returns FALSE

Post by bill davids » Tue, 18 Aug 1998 04:00:00




| I'm running an xterm in which "ls --color" shows nice colors for all the
| file types, but my ncurses code returns FALSE when I call has_colors().
| What do I need to do to get colors to work? Code snippet at end.

High probability that you have your $TERM set wrong.
--

  I never said I didn't want to offend anyone, I said I didn't want to
offend anyone unintentionally.

 
 
 

1. I need 'false|true' return 1

When I run pipes in bash (shell) it returns exit code of the last
program.
Example:
% true | true && echo yes || echo no
yes
% true | false && echo yes || echo no
no
% false | false && echo yes || echo no
no
% false | true && echo yes || echo no
yes

But I need the following:
% true | true && echo yes || echo no
yes
% true | false && echo yes || echo no
no
% false | false && echo yes || echo no
no
% false | true && echo yes || echo no
no

The difference is only in last command 'false | true'.

Is it possible to do so in bash (or may be in csh, ksh, zsh)?

2. Help:Start-up Module Error Message

3. sh -e not halted by "test" returning 1 [false]

4. Theme manager

5. Help with False ${FALSE}

6. mutex shared by processes

7. why does false || false = true ???

8. pppd can't startup!

9. Lost Return key on new Linux ncurses recompile?

10. Ncurses.4 s ncurse.5

11. The return of the return of crunch time (2.5 merge candidate list 1.6)

12. Problem: Command substitution adds an extra carriage return character on return.

13. pf and return-rst & return-icmp Huh?