mirror of
https://github.com/tmux/tmux.git
synced 2024-12-13 01:48:47 +00:00
Sync OpenBSD patchset 701:
Colour+attribute options for status line alerts, from Alex Alexander.
This commit is contained in:
parent
6c6255f2d7
commit
11cd05db27
@ -1,4 +1,4 @@
|
||||
/* $Id: cmd-set-option.c,v 1.96 2010-02-26 13:31:39 tcunha Exp $ */
|
||||
/* $Id: cmd-set-option.c,v 1.97 2010-06-05 23:56:29 tcunha Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -157,6 +157,9 @@ const struct set_option_entry set_window_option_table[] = {
|
||||
{ "remain-on-exit", SET_OPTION_FLAG, 0, 0, NULL },
|
||||
{ "synchronize-panes", SET_OPTION_FLAG, 0, 0, NULL },
|
||||
{ "utf8", SET_OPTION_FLAG, 0, 0, NULL },
|
||||
{ "window-status-alert-attr", SET_OPTION_ATTRIBUTES, 0, 0, NULL },
|
||||
{ "window-status-alert-bg", SET_OPTION_COLOUR, 0, 0, NULL },
|
||||
{ "window-status-alert-fg", SET_OPTION_COLOUR, 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 },
|
||||
|
15
status.c
15
status.c
@ -1,4 +1,4 @@
|
||||
/* $Id: status.c,v 1.147 2010-04-06 21:45:36 nicm Exp $ */
|
||||
/* $Id: status.c,v 1.148 2010-06-05 23:56:29 tcunha Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -595,8 +595,17 @@ status_print(
|
||||
|
||||
if (session_alert_has(s, wl, WINDOW_ACTIVITY) ||
|
||||
session_alert_has(s, wl, WINDOW_BELL) ||
|
||||
session_alert_has(s, wl, WINDOW_CONTENT))
|
||||
gc->attr ^= GRID_ATTR_REVERSE;
|
||||
session_alert_has(s, wl, WINDOW_CONTENT)) {
|
||||
fg = options_get_number(oo, "window-status-alert-fg");
|
||||
if (fg != 8)
|
||||
colour_set_fg(gc, fg);
|
||||
bg = options_get_number(oo, "window-status-alert-bg");
|
||||
if (bg != 8)
|
||||
colour_set_bg(gc, bg);
|
||||
attr = options_get_number(oo, "window-status-alert-attr");
|
||||
if (attr != 0)
|
||||
gc->attr = attr;
|
||||
}
|
||||
|
||||
text = status_replace(c, wl, fmt, t, 1);
|
||||
return (text);
|
||||
|
12
tmux.1
12
tmux.1
@ -1,4 +1,4 @@
|
||||
.\" $Id: tmux.1,v 1.250 2010-06-05 23:54:51 tcunha Exp $
|
||||
.\" $Id: tmux.1,v 1.251 2010-06-05 23:56:29 tcunha Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
.\"
|
||||
@ -2073,6 +2073,16 @@ option for details of special character sequences available.
|
||||
The default is
|
||||
.Ql #I:#W#F .
|
||||
.Pp
|
||||
.It Ic window-status-alert-attr Ar attributes
|
||||
Set status line attributes for windows which have an alert (bell, activity
|
||||
or content).
|
||||
.Pp
|
||||
.It Ic window-status-alert-bg Ar colour
|
||||
Set status line background colour for windows with an alert.
|
||||
.Pp
|
||||
.It Ic window-status-alert-fg Ar colour
|
||||
Set status line foreground colour for windows with an alert.
|
||||
.Pp
|
||||
.It Ic window-status-current-attr Ar attributes
|
||||
Set status line attributes for the currently active window.
|
||||
.Pp
|
||||
|
5
tmux.c
5
tmux.c
@ -1,4 +1,4 @@
|
||||
/* $Id: tmux.c,v 1.208 2010-05-16 17:50:31 nicm Exp $ */
|
||||
/* $Id: tmux.c,v 1.209 2010-06-05 23:56:29 tcunha Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -419,6 +419,9 @@ main(int argc, char **argv)
|
||||
options_set_number(wo, "window-status-current-bg", 8);
|
||||
options_set_number(wo, "window-status-current-fg", 8);
|
||||
options_set_number(wo, "window-status-fg", 8);
|
||||
options_set_number(wo, "window-status-alert-attr", GRID_ATTR_REVERSE);
|
||||
options_set_number(wo, "window-status-alert-bg", 8);
|
||||
options_set_number(wo, "window-status-alert-fg", 8);
|
||||
options_set_string(wo, "window-status-format", "#I:#W#F");
|
||||
options_set_string(wo, "window-status-current-format", "#I:#W#F");
|
||||
options_set_string(wo, "word-separators", " -_@");
|
||||
|
Loading…
Reference in New Issue
Block a user