Changeset 234


Ignore:
Timestamp:
Nov 29, 2003, 7:04:42 PM (17 years ago)
Author:
Sam Hocevar
Message:
  • src/caca.c: + Test whether ncurses knows xterm-16color before setting $TERM.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/src/caca.c

    r232 r234  
    205205{
    206206#if defined(HAVE_GETENV) && defined(HAVE_PUTENV)
    207     char *term, *colorterm, *misc;
     207    char *term, *colorterm, *other;
    208208
    209209    term = getenv("TERM");
     
    215215        if(colorterm && !strcmp(colorterm, "gnome-terminal"))
    216216        {
     217#if defined(USE_NCURSES)
     218            SCREEN *screen;
     219            screen = newterm("xterm-16color", stdout, stdin);
     220            if(screen == NULL)
     221                return;
     222            endwin();
     223#endif
    217224            (void)putenv("TERM=xterm-16color");
    218225            return;
     
    220227
    221228        /* Ditto if we are using Konsole */
    222         misc = getenv("KONSOLE_DCOP_SESSION");
    223         if(misc)
     229        other = getenv("KONSOLE_DCOP_SESSION");
     230        if(other)
    224231        {
     232#if defined(USE_NCURSES)
     233            SCREEN *screen;
     234            screen = newterm("xterm-16color", stdout, stdin);
     235            if(screen == NULL)
     236                return;
     237            endwin();
     238#endif
    225239            (void)putenv("TERM=xterm-16color");
    226240            return;
Note: See TracChangeset for help on using the changeset viewer.