> > > What does "echo $TERM" show before you attach tmux?
> >
> > again, this seems to be a putty specific issue.
> > no problems whatsoever on local terminal.
> > TERM is set to xterm before i run tmux, then it changes to screen.
>
> The xterm terminal description does not support colour so tmux does not
> attempt
> to use it, use a terminal description that does have it such as xterm-color or
> xterm-xfree86.
This causes problems fora lot of people, I don't think there are any b&w xterms
out there and recent ncurses does have setaf/setab in its xterm
description... so I don't see a reason we shouldn't just have a quirk to
override it. Could you try this please?
Index: tty-term.c
===================================================================
RCS file: /cvs/src/usr.bin/tmux/tty-term.c,v
retrieving revision 1.2
diff -u -p -r1.2 tty-term.c
--- tty-term.c 5 Jun 2009 03:13:16 -0000 1.2
+++ tty-term.c 13 Jul 2009 01:26:12 -0000
@@ -151,6 +151,18 @@ tty_term_quirks(struct tty_term *term)
}
if (strncmp(term->name, "xterm", 5) == 0) {
+ /* xterms have colour, but some termcaps do not. */
+ if (!tty_term_has(term, TTYC_SETAF)) {
+ term->codes[TTYC_SETAF].type = TTYCODE_STRING;
+ term->codes[TTYC_SETAF].value.string =
+ xstrdup("\033[3%p1%dm");
+ }
+ if (!tty_term_has(term, TTYC_SETAB)) {
+ term->codes[TTYC_SETAB].type = TTYCODE_STRING;
+ term->codes[TTYC_SETAB].value.string =
+ xstrdup("\033[4%p1%dm");
+ }
+
/* xterm supports ich1 but some termcaps omit it. */
if (!tty_term_has(term, TTYC_ICH1)) {
term->codes[TTYC_ICH1].type = TTYCODE_STRING;