Kaynağa Gözat

* src/caca.c:

+ Test whether ncurses knows xterm-16color before setting $TERM.
tags/v0.99.beta14
Sam Hocevar sam 21 yıl önce
ebeveyn
işleme
a444ef6168
1 değiştirilmiş dosya ile 17 ekleme ve 3 silme
  1. +17
    -3
      src/caca.c

+ 17
- 3
src/caca.c Dosyayı Görüntüle

@@ -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;
}


Yükleniyor…
İptal
Kaydet