Set window title to current session. New options set-titles to disable.

This commit is contained in:
Nicholas Marriott
2008-06-18 18:52:44 +00:00
parent f9dedfccca
commit 8873c79cbc
8 changed files with 58 additions and 23 deletions

12
tty.c
View File

@ -1,4 +1,4 @@
/* $Id: tty.c,v 1.23 2008-06-10 18:51:22 nicm Exp $ */
/* $Id: tty.c,v 1.24 2008-06-18 18:52:44 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -342,6 +342,14 @@ tty_putc(struct tty *tty, char ch)
buffer_write8(tty->out, ch);
}
void
tty_set_title(struct tty *tty, const char *title)
{
tty_puts(tty, "\e]0;");
tty_puts(tty, title);
tty_putc(tty, '\007');
}
void
tty_vwrite(struct tty *tty, struct screen *s, int cmd, va_list ap)
{
@ -544,8 +552,6 @@ tty_vwrite(struct tty *tty, struct screen *s, int cmd, va_list ap)
if (key_mouse != NULL)
tty_puts(tty, "\e[?1000h");
break;
case TTY_TITLE:
break;
case TTY_ATTRIBUTES:
ua = va_arg(ap, u_int);
ub = va_arg(ap, u_int);