mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Support setting the default window and pane background colours (window
and active pane via window-style and window-active-style options, an individual pane by a new select-pane -P flag). From J Raynor.
This commit is contained in:
		@@ -266,7 +266,7 @@ screen_redraw_pane(struct client *c, struct window_pane *wp)
 | 
			
		||||
		yoff++;
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < wp->sy; i++)
 | 
			
		||||
		tty_draw_line(&c->tty, wp->screen, i, wp->xoff, yoff);
 | 
			
		||||
		tty_draw_pane(&c->tty, wp, i, wp->xoff, yoff);
 | 
			
		||||
	tty_reset(&c->tty);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -323,9 +323,9 @@ screen_redraw_draw_borders(struct client *c, int status, u_int top)
 | 
			
		||||
			    small && i > msgx && j == msgy)
 | 
			
		||||
				continue;
 | 
			
		||||
			if (screen_redraw_check_active(i, j, type, w, wp))
 | 
			
		||||
				tty_attributes(tty, &active_gc);
 | 
			
		||||
				tty_attributes(tty, &active_gc, NULL);
 | 
			
		||||
			else
 | 
			
		||||
				tty_attributes(tty, &other_gc);
 | 
			
		||||
				tty_attributes(tty, &other_gc, NULL);
 | 
			
		||||
			tty_cursor(tty, i, top + j);
 | 
			
		||||
			tty_putc(tty, CELL_BORDERS[type]);
 | 
			
		||||
		}
 | 
			
		||||
@@ -333,7 +333,7 @@ screen_redraw_draw_borders(struct client *c, int status, u_int top)
 | 
			
		||||
 | 
			
		||||
	if (small) {
 | 
			
		||||
		memcpy(&msg_gc, &grid_default_cell, sizeof msg_gc);
 | 
			
		||||
		tty_attributes(tty, &msg_gc);
 | 
			
		||||
		tty_attributes(tty, &msg_gc, NULL);
 | 
			
		||||
		tty_cursor(tty, msgx, msgy);
 | 
			
		||||
		tty_puts(tty, msg);
 | 
			
		||||
	}
 | 
			
		||||
@@ -346,15 +346,13 @@ screen_redraw_draw_panes(struct client *c, u_int top)
 | 
			
		||||
	struct window		*w = c->session->curw->window;
 | 
			
		||||
	struct tty		*tty = &c->tty;
 | 
			
		||||
	struct window_pane	*wp;
 | 
			
		||||
	struct screen		*s;
 | 
			
		||||
	u_int		 	 i;
 | 
			
		||||
 | 
			
		||||
	TAILQ_FOREACH(wp, &w->panes, entry) {
 | 
			
		||||
		if (!window_pane_visible(wp))
 | 
			
		||||
			continue;
 | 
			
		||||
		s = wp->screen;
 | 
			
		||||
		for (i = 0; i < wp->sy; i++)
 | 
			
		||||
			tty_draw_line(tty, s, i, wp->xoff, top + wp->yoff);
 | 
			
		||||
			tty_draw_pane(tty, wp, i, wp->xoff, top + wp->yoff);
 | 
			
		||||
		if (c->flags & CLIENT_IDENTIFY)
 | 
			
		||||
			screen_redraw_draw_number(c, wp);
 | 
			
		||||
	}
 | 
			
		||||
@@ -367,9 +365,9 @@ screen_redraw_draw_status(struct client *c, u_int top)
 | 
			
		||||
	struct tty	*tty = &c->tty;
 | 
			
		||||
 | 
			
		||||
	if (top)
 | 
			
		||||
		tty_draw_line(tty, &c->status, 0, 0, 0);
 | 
			
		||||
		tty_draw_line(tty, NULL, &c->status, 0, 0, 0);
 | 
			
		||||
	else
 | 
			
		||||
		tty_draw_line(tty, &c->status, 0, 0, tty->sy - 1);
 | 
			
		||||
		tty_draw_line(tty, NULL, &c->status, 0, 0, tty->sy - 1);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Draw number on a pane. */
 | 
			
		||||
@@ -411,7 +409,7 @@ screen_redraw_draw_number(struct client *c, struct window_pane *wp)
 | 
			
		||||
		colour_set_bg(&gc, active_colour);
 | 
			
		||||
	else
 | 
			
		||||
		colour_set_bg(&gc, colour);
 | 
			
		||||
	tty_attributes(tty, &gc);
 | 
			
		||||
	tty_attributes(tty, &gc, wp);
 | 
			
		||||
	for (ptr = buf; *ptr != '\0'; ptr++) {
 | 
			
		||||
		if (*ptr < '0' || *ptr > '9')
 | 
			
		||||
			continue;
 | 
			
		||||
@@ -438,7 +436,7 @@ draw_text:
 | 
			
		||||
		colour_set_fg(&gc, active_colour);
 | 
			
		||||
	else
 | 
			
		||||
		colour_set_fg(&gc, colour);
 | 
			
		||||
	tty_attributes(tty, &gc);
 | 
			
		||||
	tty_attributes(tty, &gc, wp);
 | 
			
		||||
	tty_puts(tty, buf);
 | 
			
		||||
 | 
			
		||||
	tty_cursor(tty, 0, 0);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user