From 93224260ae42b8d2c85e702453779b8ff583f561 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Tue, 27 Nov 2012 13:52:23 +0000 Subject: [PATCH] Add window-status-last-* options, from Boris Faure. --- options-table.c | 15 +++++++++++++++ status.c | 11 +++++++++++ tmux.1 | 9 +++++++++ 3 files changed, 35 insertions(+) diff --git a/options-table.c b/options-table.c index 3e471908..d9bbe382 100644 --- a/options-table.c +++ b/options-table.c @@ -686,6 +686,21 @@ const struct options_table_entry window_options_table[] = { .default_str = "#I:#W#F" }, + { .name = "window-status-last-attr", + .type = OPTIONS_TABLE_ATTRIBUTES, + .default_num = 0 + }, + + { .name = "window-status-last-bg", + .type = OPTIONS_TABLE_COLOUR, + .default_num = 8 + }, + + { .name = "window-status-last-fg", + .type = OPTIONS_TABLE_COLOUR, + .default_num = 8 + }, + { .name = "window-status-fg", .type = OPTIONS_TABLE_COLOUR, .default_num = 8 diff --git a/status.c b/status.c index 6cbdc6c4..dd4c737c 100644 --- a/status.c +++ b/status.c @@ -705,6 +705,17 @@ status_print( gc->attr = attr; fmt = options_get_string(oo, "window-status-current-format"); } + if (wl == TAILQ_FIRST(&s->lastw)) { + fg = options_get_number(oo, "window-status-last-fg"); + if (fg != 8) + colour_set_fg(gc, fg); + bg = options_get_number(oo, "window-status-last-bg"); + if (bg != 8) + colour_set_bg(gc, bg); + attr = options_get_number(oo, "window-status-last-attr"); + if (attr != 0) + gc->attr = attr; + } if (wl->flags & WINLINK_BELL) { fg = options_get_number(oo, "window-status-bell-fg"); diff --git a/tmux.1 b/tmux.1 index 4bf55443..185a4303 100644 --- a/tmux.1 +++ b/tmux.1 @@ -2823,6 +2823,15 @@ Like .Ar window-status-format , but is the format used when the window is the current window. .Pp +.It Ic window-status-last-attr Ar attributes +Set status line attributes for the last active window. +.Pp +.It Ic window-status-last-bg Ar colour +Set status line background colour for the last active window. +.Pp +.It Ic window-status-last-fg Ar colour +Set status line foreground colour for the last active window. +.Pp .It Ic window-status-fg Ar colour Set status line foreground colour for a single window. .Pp