diff options
author | james <> | 2008-03-06 21:33:02 +0000 |
---|---|---|
committer | james <> | 2008-03-06 21:33:02 +0000 |
commit | 63a3f74532632a7e07b71f805eb806b05b3f19e3 (patch) | |
tree | 07e9b206c5f8d30e11e6780658ddedfc25e32c77 /src | |
parent | 9d7972be8f555a5ece9a8e7b1b6275a9d7c0b212 (diff) | |
download | sympathy-63a3f74532632a7e07b71f805eb806b05b3f19e3.tar.gz sympathy-63a3f74532632a7e07b71f805eb806b05b3f19e3.tar.bz2 sympathy-63a3f74532632a7e07b71f805eb806b05b3f19e3.zip |
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r-- | src/ansi.c | 20 | ||||
-rw-r--r-- | src/ansi.h | 4 | ||||
-rw-r--r-- | src/raw.c | 4 |
3 files changed, 27 insertions, 1 deletions
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$"; /* * $Log$ + * Revision 1.46 2008/03/06 21:33:02 james + * *** empty log message *** + * * Revision 1.45 2008/03/06 17:21:41 james * *** empty log message *** * @@ -288,6 +291,21 @@ ansi_force_attr_normal (ANSI * a) return 0; } +static int ansi_set_title(ANSI *a,char *t) +{ +char buf[1024]; +int i; +char *term=getenv("TERM"); + +if (!term) return 0; +if (strncmp(term,"xterm",5) && strncmp(term,"rxvt",4)) return 0; + +i=sprintf(buf,"\033]0;%s\007",t); + +if (a->terminal->xmit(a->terminal,buf,i)!=i) return 1; +return 0; +} + static int ansi_set_color (ANSI * a, int color) { @@ -981,6 +999,7 @@ ansi_dispatch (ANSI * a, Context * c) } + static int ansi_update (ANSI * a, Context * c) { @@ -1016,6 +1035,7 @@ ansi_new_from_terminal (TTY * t, int utf8) ret->update = ansi_update; ret->reset = ansi_reset; ret->terminal_reset = ansi_terminal_reset; + ret->set_title=ansi_set_title; ret->close = ansi_free; ret->dispatch = ansi_dispatch; @@ -12,6 +12,9 @@ /* * $Log$ + * Revision 1.17 2008/03/06 21:33:02 james + * *** empty log message *** + * * Revision 1.16 2008/03/06 16:49:05 james * *** empty log message *** * @@ -105,6 +108,7 @@ typedef struct ANSI_struct int (*update) (struct ANSI_struct *, struct Context_struct *); int (*one_shot) (struct ANSI_struct *, struct CRT_struct *); int (*reset) (struct ANSI_struct *, struct CRT_struct *); + int (*set_title) (struct ANSI_struct *,char *); void (*terminal_reset) (struct ANSI_struct *); void (*close) (struct ANSI_struct *); } ANSI; @@ -10,6 +10,9 @@ static char rcsid[] = "$Id$"; /* * $Log$ + * Revision 1.4 2008/03/06 21:33:02 james + * *** empty log message *** + * * Revision 1.3 2008/03/06 17:21:41 james * *** empty log message *** * @@ -43,7 +46,6 @@ rx_raw_rx (RX * _r, int ch) RX_Raw *r = (RX_Raw *) _r; int ret; uint8_t c = ch; - printf("RX RAW %d\n",ch); set_blocking(r->wfd); ret=(write (r->wfd, &c, 1) == 1) ? 0 : -1; } |