aboutsummaryrefslogtreecommitdiff
path: root/tty.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2011-05-18 20:28:43 +0000
committerTiago Cunha <tcunha@gmx.com>2011-05-18 20:28:43 +0000
commit4fcbf4b872bb2b30a34edaf7e0b95a01c17a8aa7 (patch)
tree3e2246963d761c24ccfd19327ce0d2b07d940ab9 /tty.c
parent046e8363b4f07dae83b6390e8dc49628dd0f250a (diff)
downloadrtmux-4fcbf4b872bb2b30a34edaf7e0b95a01c17a8aa7.tar.gz
rtmux-4fcbf4b872bb2b30a34edaf7e0b95a01c17a8aa7.tar.bz2
rtmux-4fcbf4b872bb2b30a34edaf7e0b95a01c17a8aa7.zip
Sync OpenBSD patchset 904:
Use the tsl and fsl terminfo(5) capabilities to update terminal title and automatically fill them in on terminals with the XT capability (which means their title setting is xterm-compatible). From hsim at gmx.li.
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/tty.c b/tty.c
index c6b7654a..ea37f6d3 100644
--- a/tty.c
+++ b/tty.c
@@ -1,4 +1,4 @@
-/* $Id: tty.c,v 1.208 2011-04-09 07:48:58 nicm Exp $ */
+/* $Id: tty.c,v 1.209 2011-05-18 20:28:43 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -369,14 +369,13 @@ tty_pututf8(struct tty *tty, const struct grid_utf8 *gu)
void
tty_set_title(struct tty *tty, const char *title)
{
- if (strstr(tty->termname, "xterm") == NULL &&
- strstr(tty->termname, "rxvt") == NULL &&
- strcmp(tty->termname, "screen") != 0)
+ if (!tty_term_has(tty->term, TTYC_TSL) ||
+ !tty_term_has(tty->term, TTYC_FSL))
return;
- tty_puts(tty, "\033]0;");
+ tty_putcode(tty, TTYC_TSL);
tty_puts(tty, title);
- tty_putc(tty, '\007');
+ tty_putcode(tty, TTYC_FSL);
}
void