From 8873c79cbcaf799ca4b371faf24564664aedc850 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 18 Jun 2008 18:52:44 +0000 Subject: Set window title to current session. New options set-titles to disable. --- tty.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'tty.c') diff --git a/tty.c b/tty.c index 944ad8fa..89df5f33 100644 --- a/tty.c +++ b/tty.c @@ -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 @@ -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); -- cgit