mirror of
https://github.com/tmux/tmux.git
synced 2025-01-15 05:09:04 +00:00
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.
This commit is contained in:
parent
73732ffa05
commit
e32e0d5692
@ -68,6 +68,9 @@ const struct set_option_entry set_window_option_table[] = {
|
|||||||
{ "utf8", SET_OPTION_FLAG, 0, 0, NULL },
|
{ "utf8", SET_OPTION_FLAG, 0, 0, NULL },
|
||||||
{ "window-status-attr", SET_OPTION_ATTRIBUTES, 0, 0, NULL },
|
{ "window-status-attr", SET_OPTION_ATTRIBUTES, 0, 0, NULL },
|
||||||
{ "window-status-bg", SET_OPTION_COLOUR, 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 },
|
{ "window-status-fg", SET_OPTION_COLOUR, 0, 0, NULL },
|
||||||
{ "xterm-keys", SET_OPTION_FLAG, 0, 0, NULL },
|
{ "xterm-keys", SET_OPTION_FLAG, 0, 0, NULL },
|
||||||
{ NULL, 0, 0, 0, NULL }
|
{ NULL, 0, 0, 0, NULL }
|
||||||
|
12
status.c
12
status.c
@ -460,8 +460,18 @@ status_print(struct session *s, struct winlink *wl, struct grid_cell *gc)
|
|||||||
flag = ' ';
|
flag = ' ';
|
||||||
if (wl == SLIST_FIRST(&s->lastw))
|
if (wl == SLIST_FIRST(&s->lastw))
|
||||||
flag = '-';
|
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 = '*';
|
flag = '*';
|
||||||
|
}
|
||||||
|
|
||||||
if (session_alert_has(s, wl, WINDOW_ACTIVITY)) {
|
if (session_alert_has(s, wl, WINDOW_ACTIVITY)) {
|
||||||
flag = '#';
|
flag = '#';
|
||||||
|
6
tmux.1
6
tmux.1
@ -1489,6 +1489,12 @@ Set status line attributes for a single window.
|
|||||||
Set status line background colour for a single window.
|
Set status line background colour for a single window.
|
||||||
.It Ic window-status-fg Ar colour
|
.It Ic window-status-fg Ar colour
|
||||||
Set status line foreground colour for a single window.
|
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
|
.It Xo Ic xterm-keys
|
||||||
.Op Ic on | Ic off
|
.Op Ic on | Ic off
|
||||||
.Xc
|
.Xc
|
||||||
|
3
tmux.c
3
tmux.c
@ -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-attr", 0);
|
||||||
options_set_number(&global_w_options, "window-status-bg", 8);
|
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-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, "xterm-keys", 0);
|
||||||
options_set_number(&global_w_options, "remain-on-exit", 0);
|
options_set_number(&global_w_options, "remain-on-exit", 0);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user