diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2011-05-08 19:53:06 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2011-05-08 19:53:06 +0000 |
commit | 295ace682020769be8a6a6a02835099d93c392ef (patch) | |
tree | d55f3d1563aa55d9a5d9aa95eb4bdc29fed2afee /tty.c | |
parent | b0a88ebeadd56ebcb0cdbe9967a869d361b96c6f (diff) |
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.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -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 |