diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-07-20 09:15:19 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-07-20 09:15:19 +0000 |
commit | 281ace9111ced0f82d23c56782989c9361bbcf1a (patch) | |
tree | 16a5cbc4d333677bbe73e245aeabd1829f16bd2b /usr.bin/tmux | |
parent | 52b361f09e9f4b600890624ab0f0219cd5873396 (diff) |
New options, window-status-current-{fg,bg,attr}, to set the fg, bg and
attributes with which the current window is shown in the status line. From
Johan Friis, thanks.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/cmd-set-window-option.c | 5 | ||||
-rw-r--r-- | usr.bin/tmux/status.c | 14 | ||||
-rw-r--r-- | usr.bin/tmux/tmux.1 | 10 | ||||
-rw-r--r-- | usr.bin/tmux/tmux.c | 5 |
4 files changed, 28 insertions, 6 deletions
diff --git a/usr.bin/tmux/cmd-set-window-option.c b/usr.bin/tmux/cmd-set-window-option.c index aa3681bcad1..e99c33a0e25 100644 --- a/usr.bin/tmux/cmd-set-window-option.c +++ b/usr.bin/tmux/cmd-set-window-option.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-set-window-option.c,v 1.6 2009/07/15 07:50:34 nicm Exp $ */ +/* $OpenBSD: cmd-set-window-option.c,v 1.7 2009/07/20 09:15:18 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> @@ -68,6 +68,9 @@ const struct set_option_entry set_window_option_table[] = { { "utf8", SET_OPTION_FLAG, 0, 0, NULL }, { "window-status-attr", SET_OPTION_ATTRIBUTES, 0, 0, NULL }, { "window-status-bg", SET_OPTION_COLOUR, 0, 0, NULL }, + { "window-status-current-attr", SET_OPTION_ATTRIBUTES, 0, 0, NULL }, + { "window-status-current-bg", SET_OPTION_COLOUR, 0, 0, NULL }, + { "window-status-current-fg", SET_OPTION_COLOUR, 0, 0, NULL }, { "window-status-fg", SET_OPTION_COLOUR, 0, 0, NULL }, { "xterm-keys", SET_OPTION_FLAG, 0, 0, NULL }, { NULL, 0, 0, 0, NULL } diff --git a/usr.bin/tmux/status.c b/usr.bin/tmux/status.c index 166748aad3a..57b9d0578a6 100644 --- a/usr.bin/tmux/status.c +++ b/usr.bin/tmux/status.c @@ -1,4 +1,4 @@ -/* $OpenBSD: status.c,v 1.13 2009/07/17 18:45:08 nicm Exp $ */ +/* $OpenBSD: status.c,v 1.14 2009/07/20 09:15:18 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -460,8 +460,18 @@ status_print(struct session *s, struct winlink *wl, struct grid_cell *gc) flag = ' '; if (wl == SLIST_FIRST(&s->lastw)) flag = '-'; - if (wl == s->curw) + if (wl == s->curw) { + fg = options_get_number(&wl->window->options, "window-status-current-fg"); + if (fg != 8) + gc->fg = fg; + bg = options_get_number(&wl->window->options, "window-status-current-bg"); + if (bg != 8) + gc->bg = bg; + attr = options_get_number(&wl->window->options, "window-status-current-attr"); + if (attr != 0) + gc->attr = attr; flag = '*'; + } if (session_alert_has(s, wl, WINDOW_ACTIVITY)) { flag = '#'; diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1 index 5af5301cee1..6d4d8d779ab 100644 --- a/usr.bin/tmux/tmux.1 +++ b/usr.bin/tmux/tmux.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tmux.1,v 1.39 2009/07/19 14:07:47 jmc Exp $ +.\" $OpenBSD: tmux.1,v 1.40 2009/07/20 09:15:18 nicm Exp $ .\" .\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> .\" @@ -14,7 +14,7 @@ .\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: July 19 2009 $ +.Dd $Mdocdate: July 20 2009 $ .Dt TMUX 1 .Os .Sh NAME @@ -1489,6 +1489,12 @@ Set status line attributes for a single window. Set status line background colour for a single window. .It Ic window-status-fg Ar colour Set status line foreground colour for a single window. +.It Ic window-status-current-attr Ar attributes +Set status line attributes for the currently active window. +.It Ic window-status-current-bg Ar colour +Set status line background colour for the currently active window. +.It Ic window-status-current-fg Ar colour +Set status line foreground colour for the currently active window. .It Xo Ic xterm-keys .Op Ic on | Ic off .Xc diff --git a/usr.bin/tmux/tmux.c b/usr.bin/tmux/tmux.c index fba16c62d9e..690cc3062cc 100644 --- a/usr.bin/tmux/tmux.c +++ b/usr.bin/tmux/tmux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.c,v 1.16 2009/07/18 14:59:25 nicm Exp $ */ +/* $OpenBSD: tmux.c,v 1.17 2009/07/20 09:15:18 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -338,6 +338,9 @@ main(int argc, char **argv) options_set_number(&global_w_options, "window-status-attr", 0); options_set_number(&global_w_options, "window-status-bg", 8); options_set_number(&global_w_options, "window-status-fg", 8); + options_set_number(&global_w_options, "window-status-current-attr", 0); + options_set_number(&global_w_options, "window-status-current-bg", 8); + options_set_number(&global_w_options, "window-status-current-fg", 8); options_set_number(&global_w_options, "xterm-keys", 0); options_set_number(&global_w_options, "remain-on-exit", 0); |