? Session.vim
? multi-colour-statusbar.patch
? multi-colour-statusbar2.patch
? status.patch
Index: cmd-set-option.c
===================================================================
RCS file: /cvsroot/tmux/tmux/cmd-set-option.c,v
retrieving revision 1.70
diff -u -r1.70 cmd-set-option.c
--- cmd-set-option.c	28 Jul 2009 22:12:16 -0000	1.70
+++ cmd-set-option.c	7 Aug 2009 06:06:45 -0000
@@ -74,8 +74,14 @@
 	  SET_OPTION_CHOICE, 0, 0, set_option_status_justify_list },
 	{ "status-keys", SET_OPTION_CHOICE, 0, 0, set_option_status_keys_list },
 	{ "status-left", SET_OPTION_STRING, 0, 0, NULL },
+	{ "status-left-attr", SET_OPTION_ATTRIBUTES, 0, 0, NULL },
+	{ "status-left-bg", SET_OPTION_COLOUR, 0, 0, NULL },
+	{ "status-left-fg", SET_OPTION_COLOUR, 0, 0, NULL },
 	{ "status-left-length", SET_OPTION_NUMBER, 0, SHRT_MAX, NULL },
 	{ "status-right", SET_OPTION_STRING, 0, 0, NULL },
+	{ "status-right-attr", SET_OPTION_ATTRIBUTES, 0, 0, NULL },
+	{ "status-right-bg", SET_OPTION_COLOUR, 0, 0, NULL },
+	{ "status-right-fg", SET_OPTION_COLOUR, 0, 0, NULL },
 	{ "status-right-length", SET_OPTION_NUMBER, 0, SHRT_MAX, NULL },
 	{ "status-utf8", SET_OPTION_FLAG, 0, 0, NULL },
 	{ "visual-activity", SET_OPTION_FLAG, 0, 0, NULL },
Index: status.c
===================================================================
RCS file: /cvsroot/tmux/tmux/status.c,v
retrieving revision 1.107
diff -u -r1.107 status.c
--- status.c	30 Jul 2009 21:14:04 -0000	1.107
+++ status.c	7 Aug 2009 06:06:46 -0000
@@ -47,8 +47,10 @@
 	char		 	       *left, *right, *text, *ptr;
 	size_t				llen, llen2, rlen, rlen2, offset;
 	size_t				ox, xx, yy, size, start, width;
-	struct grid_cell	        stdgc, gc;
+	struct grid_cell	        stdgc, sl_stdgc, sr_stdgc, gc;
 	int				larrow, rarrow, utf8flag;
+	int				sl_fg, sl_bg, sr_fg, sr_bg;
+	int				sl_attr, sr_attr;
 
 	left = right = NULL;
 
@@ -64,10 +66,54 @@
 	if (gettimeofday(&c->status_timer, NULL) != 0)
 		fatal("gettimeofday");
 	memcpy(&stdgc, &grid_default_cell, sizeof gc);
+	memcpy(&sl_stdgc, &grid_default_cell, sizeof gc);
+	memcpy(&sr_stdgc, &grid_default_cell, sizeof gc);
+
+	/* Assume the entire status line. */
 	stdgc.bg = options_get_number(&s->options, "status-fg");
 	stdgc.fg = options_get_number(&s->options, "status-bg");
 	stdgc.attr |= options_get_number(&s->options, "status-attr");
 
+	/* Set the status left and status right parts to the same fg/bg colour
+	 * as the status line above -- and only change them below where they
+	 * differ from the defaults.
+	 */
+	sl_stdgc.fg = stdgc.fg;
+	sl_stdgc.bg = stdgc.bg;
+	sr_stdgc.fg = stdgc.fg;
+	sr_stdgc.bg = stdgc.bg;
+	sl_stdgc.attr = stdgc.attr;
+	sr_stdgc.attr = stdgc.attr;
+
+	/* Left status line options. */
+	sl_bg = options_get_number(&s->options, "status-left-bg");
+	if (sl_bg != 2)
+		sl_stdgc.bg = sl_bg;		
+	
+	sl_fg = options_get_number(&s->options, "status-left-fg");
+	if (sl_fg != 0)
+		sl_stdgc.fg = sl_fg;
+
+	sl_attr = options_get_number(&s->options, "status-left-attr");
+	if (sl_attr != 0)
+		sl_stdgc.attr |= sl_attr;
+
+	/* Right status line options. */
+	sr_bg = options_get_number(&s->options, "status-right-bg");
+	if (sr_bg != 2)
+		sr_stdgc.bg = sr_bg;
+
+	sr_fg = options_get_number(&s->options, "status-right-fg");
+	if (sr_fg != 0)
+		sr_stdgc.fg = sr_fg;
+
+	sr_attr = options_get_number(&s->options, "status-right-attr");
+	if (sr_attr != 0)
+		sr_stdgc.attr |= sr_attr;
+
+	log_debug( "slbg = %d | slfg = %d | sl_attr = %d | srbg = %d | srfg = %d | srattr = %d",
+			sl_bg, sl_fg, sl_attr, sr_bg, sr_fg, sr_attr);
+
 	yy = c->tty.sy - 1;
 	if (yy == 0)
 		goto blank;
@@ -164,7 +210,7 @@
 	screen_write_start(&ctx, NULL, &c->status);
 	if (llen != 0) {
  		screen_write_cursormove(&ctx, 0, yy);
-		screen_write_nputs(&ctx, llen, &stdgc, utf8flag, "%s", left);
+		screen_write_nputs(&ctx, llen, &sl_stdgc, utf8flag, "%s", left);
 		screen_write_putc(&ctx, &stdgc, ' ');
 		if (larrow)
 			screen_write_putc(&ctx, &stdgc, ' ');
@@ -238,7 +284,7 @@
 	if (rlen != 0) {
 		screen_write_cursormove(&ctx, c->tty.sx - rlen - 1, yy);
 		screen_write_putc(&ctx, &stdgc, ' ');
-		screen_write_nputs(&ctx, rlen, &stdgc, utf8flag, "%s", right);
+		screen_write_nputs(&ctx, rlen, &sr_stdgc, utf8flag, "%s", right);
 	}
 
 	/* Draw the arrows. */
Index: tmux.1
===================================================================
RCS file: /cvsroot/tmux/tmux/tmux.1,v
retrieving revision 1.140
diff -u -r1.140 tmux.1
--- tmux.1	6 Aug 2009 19:25:44 -0000	1.140
+++ tmux.1	7 Aug 2009 06:06:47 -0000
@@ -1218,6 +1218,12 @@
 is not interpreted, to enable UTF-8, use the
 .Ic status-utf8
 option.
+.It Ic status-left-attr Ar attributes
+Sets the attributes of the left part of the status line. 
+.It Ic status-left-fg Ar colour
+Sets the foreground colour of the left part of the status line.
+.It Ic status-left-bg Ar colour
+Sets the background colour of the left part of the status line.
 .It Ic status-left-length Ar length
 Set the maximum
 .Ar length
@@ -1236,6 +1242,12 @@
 character pairs are replaced, and UTF-8 is dependent on the
 .Ic status-utf8
 option.
+.It Ic status-right-attr Ar attributes
+Sets the attributes of the right part of the status line. 
+.It Ic status-right-fg Ar colour
+Sets the foreground colour of the right part of the status line.
+.It Ic status-right-bg Ar colour
+Sets the background colour of the right part of the status line.
 .It Ic status-right-length Ar length
 Set the maximum
 .Ar length
@@ -1507,8 +1519,15 @@
 (which may contain dynamic content such as the time or output from a shell
 command, see the
 .Ic status-left ,
+.Ic status-left-attr ,
+.Ic status-left-bg ,
+.Ic status-left-fg ,
 .Ic status-left-length ,
 .Ic status-right ,
+.Ic status-right-attr ,
+.Ic status-right-bg ,
+.Ic status-right-fg ,
+
 and
 .Ic status-right-length
 options below), and a central window list.
Index: tmux.c
===================================================================
RCS file: /cvsroot/tmux/tmux/tmux.c,v
retrieving revision 1.153
diff -u -r1.153 tmux.c
--- tmux.c	30 Jul 2009 20:32:05 -0000	1.153
+++ tmux.c	7 Aug 2009 06:06:47 -0000
@@ -367,9 +367,15 @@
 	options_set_number(&global_s_options, "status-interval", 15);
 	options_set_number(&global_s_options, "status-keys", MODEKEY_EMACS);
 	options_set_number(&global_s_options, "status-justify", 0);
+	options_set_string(&global_s_options, "status-left", "[#S]");
+	options_set_number(&global_s_options, "status-left-attr", GRID_ATTR_REVERSE);
+	options_set_number(&global_s_options, "status-left-fg", 0);
+	options_set_number(&global_s_options, "status-left-bg", 2);
 	options_set_number(&global_s_options, "status-left-length", 10);
 	options_set_number(&global_s_options, "status-right-length", 40);
-	options_set_string(&global_s_options, "status-left", "[#S]");
+	options_set_number(&global_s_options, "status-right-attr", 0);
+	options_set_number(&global_s_options, "status-right-fg", 0);
+	options_set_number(&global_s_options, "status-right-bg", 2);
  	options_set_string(
 	    &global_s_options, "status-right", "\"#22T\" %%H:%%M %%d-%%b-%%y");
 	if (flags & IDENTIFY_UTF8)
