Ignore:
Timestamp:
Nov 14, 2006, 12:42:43 AM (14 years ago)
Author:
Sam Hocevar
Message:
  • Factored terminal title setting code.
  • Do not try to set the terminal title if TERM=linux.
File:
1 edited

Legend:

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

    r1391 r1392  
    1818#include "config.h"
    1919#include "common.h"
     20
     21#if !defined(__KERNEL__)
     22#   include <stdio.h>
     23#   include <stdlib.h>
     24#   include <string.h>
     25#endif
    2026
    2127#include "caca.h"
     
    209215}
    210216
     217void _caca_set_term_title(char const *str)
     218{
     219#if defined(HAVE_GETENV)
     220    char *term;
     221
     222    term = getenv("TERM");
     223
     224    if(!term || !strcmp(term, "linux"))
     225        return;
     226#endif
     227
     228    fprintf(stdout, "\x1b]0;%s\x07", str);
     229    fflush(stdout);
     230}
     231
Note: See TracChangeset for help on using the changeset viewer.