summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2012-11-27 13:52:23 +0000
committerNicholas Marriott <nicm@openbsd.org>2012-11-27 13:52:23 +0000
commit93224260ae42b8d2c85e702453779b8ff583f561 (patch)
tree8a38eddc186af06b91f515df83ed538b593f3e80
parent991bfcf443de261dfe9be35f9c4d26731f8a2dff (diff)
Add window-status-last-* options, from Boris Faure.
-rw-r--r--options-table.c15
-rw-r--r--status.c11
-rw-r--r--tmux.19
3 files changed, 35 insertions, 0 deletions
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