Parcourir la source

* src/caca.c:

+ Test whether ncurses knows xterm-16color before setting $TERM.
tags/v0.99.beta14
Sam Hocevar sam il y a 21 ans
Parent
révision
a444ef6168
1 fichiers modifiés avec 17 ajouts et 3 suppressions
  1. +17
    -3
      src/caca.c

+ 17
- 3
src/caca.c Voir le fichier

@@ -204,7 +204,7 @@ void caca_end(void)
static void caca_init_terminal(void)
{
#if defined(HAVE_GETENV) && defined(HAVE_PUTENV)
char *term, *colorterm, *misc;
char *term, *colorterm, *other;

term = getenv("TERM");
colorterm = getenv("COLORTERM");
@@ -214,14 +214,28 @@ static void caca_init_terminal(void)
/* If we are using gnome-terminal, it's really a 16 colour terminal */
if(colorterm && !strcmp(colorterm, "gnome-terminal"))
{
#if defined(USE_NCURSES)
SCREEN *screen;
screen = newterm("xterm-16color", stdout, stdin);
if(screen == NULL)
return;
endwin();
#endif
(void)putenv("TERM=xterm-16color");
return;
}

/* Ditto if we are using Konsole */
misc = getenv("KONSOLE_DCOP_SESSION");
if(misc)
other = getenv("KONSOLE_DCOP_SESSION");
if(other)
{
#if defined(USE_NCURSES)
SCREEN *screen;
screen = newterm("xterm-16color", stdout, stdin);
if(screen == NULL)
return;
endwin();
#endif
(void)putenv("TERM=xterm-16color");
return;
}


Chargement…
Annuler
Enregistrer