diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-21 13:11:28 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-21 13:11:28 +0000 |
commit | 456ff329c37e4c9acf815d74353638e4829e868e (patch) | |
tree | 830e7055ac8679a253fcaeb11543cd2cd9c054ad | |
parent | 91e5e9290d5d845d86ce2fb5b271a1c2b231da7a (diff) | |
download | rtmux-456ff329c37e4c9acf815d74353638e4829e868e.tar.gz rtmux-456ff329c37e4c9acf815d74353638e4829e868e.tar.bz2 rtmux-456ff329c37e4c9acf815d74353638e4829e868e.zip |
Only set title if TERM looks vaguely okay. Also use newline for, er, newline rather than cursor_down.
-rw-r--r-- | CHANGES | 5 | ||||
-rw-r--r-- | tty.c | 23 |
2 files changed, 18 insertions, 10 deletions
@@ -1,5 +1,8 @@ 21 June 2008 +* Only attempt to set the title where TERM looks like an xterm (contains + "xterm", "rxvt" or is "screen"). I hate this but I don't see a better way: + setting the title actually kills some other terminals pretty much dead. * Strip padding out of terminfo(5) strings. Currently the padding is just ignored, this may need to be altered if there are any software terminals out there that actually need it. @@ -535,4 +538,4 @@ (including mutt, emacs). No status bar yet and no key remapping or other customisation. -$Id: CHANGES,v 1.133 2008-06-21 12:41:04 nicm Exp $ +$Id: CHANGES,v 1.134 2008-06-21 13:11:28 nicm Exp $ @@ -1,4 +1,4 @@ -/* $Id: tty.c,v 1.32 2008-06-21 12:41:26 nicm Exp $ */ +/* $Id: tty.c,v 1.33 2008-06-21 13:11:28 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -101,19 +101,19 @@ tty_open(struct tty *tty, char **cause) #endif if (init_1string != NULL) - tty_raw(tty, init_1string); + tty_puts(tty, init_1string); if (init_2string != NULL) - tty_raw(tty, init_2string); + tty_puts(tty, init_2string); if (init_3string != NULL) - tty_raw(tty, init_3string); + tty_puts(tty, init_3string); if (enter_ca_mode != NULL) - tty_raw(tty, enter_ca_mode); + tty_puts(tty, enter_ca_mode); if (keypad_xmit != NULL) - tty_raw(tty, keypad_xmit); + tty_puts(tty, keypad_xmit); if (ena_acs != NULL) - tty_raw(tty, ena_acs); - tty_raw(tty, clear_screen); + tty_puts(tty, ena_acs); + tty_puts(tty, clear_screen); tty_keys_init(tty); @@ -382,6 +382,11 @@ tty_putc(struct tty *tty, char ch) 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) + return; + tty_puts(tty, "\e]0;"); tty_puts(tty, title); tty_putc(tty, '\007'); @@ -405,7 +410,7 @@ tty_vwrite(struct tty *tty, struct screen *s, int cmd, va_list ap) ch = va_arg(ap, int); switch (ch) { case '\n': /* LF */ - tty_puts(tty, cursor_down); + tty_putc(tty, '\n'); break; case '\r': /* CR */ tty_puts(tty, carriage_return); |