version 1.206, 2020/05/16 15:18:17 |
version 1.207, 2020/05/16 15:19:04 |
|
|
if (c->tty.sy == 0 || lines == 0) |
if (c->tty.sy == 0 || lines == 0) |
return (1); |
return (1); |
|
|
|
/* Create format tree. */ |
|
flags = FORMAT_STATUS; |
|
if (c->flags & CLIENT_STATUSFORCE) |
|
flags |= FORMAT_FORCE; |
|
ft = format_create(c, NULL, FORMAT_NONE, flags); |
|
format_defaults(ft, c, NULL, NULL, NULL); |
|
|
/* Set up default colour. */ |
/* Set up default colour. */ |
style_apply(&gc, s->options, "status-style", NULL); |
style_apply(&gc, s->options, "status-style", ft); |
fg = options_get_number(s->options, "status-fg"); |
fg = options_get_number(s->options, "status-fg"); |
if (fg != 8) |
if (fg != 8) |
gc.fg = fg; |
gc.fg = fg; |
|
|
} |
} |
screen_write_start(&ctx, NULL, &sl->screen); |
screen_write_start(&ctx, NULL, &sl->screen); |
|
|
/* Create format tree. */ |
|
flags = FORMAT_STATUS; |
|
if (c->flags & CLIENT_STATUSFORCE) |
|
flags |= FORMAT_FORCE; |
|
ft = format_create(c, NULL, FORMAT_NONE, flags); |
|
format_defaults(ft, c, NULL, NULL, NULL); |
|
|
|
/* Write the status lines. */ |
/* Write the status lines. */ |
o = options_get(s->options, "status-format"); |
o = options_get(s->options, "status-format"); |
if (o == NULL) { |
if (o == NULL) { |
|
|
size_t len; |
size_t len; |
u_int lines, offset; |
u_int lines, offset; |
struct grid_cell gc; |
struct grid_cell gc; |
|
struct format_tree *ft; |
|
|
if (c->tty.sx == 0 || c->tty.sy == 0) |
if (c->tty.sx == 0 || c->tty.sy == 0) |
return (0); |
return (0); |
|
|
if (len > c->tty.sx) |
if (len > c->tty.sx) |
len = c->tty.sx; |
len = c->tty.sx; |
|
|
style_apply(&gc, s->options, "message-style", NULL); |
ft = format_create_defaults(NULL, c, NULL, NULL, NULL); |
|
style_apply(&gc, s->options, "message-style", ft); |
|
format_free(ft); |
|
|
screen_write_start(&ctx, NULL, sl->active); |
screen_write_start(&ctx, NULL, sl->active); |
screen_write_fast_copy(&ctx, &sl->screen, 0, 0, c->tty.sx, lines - 1); |
screen_write_fast_copy(&ctx, &sl->screen, 0, 0, c->tty.sx, lines - 1); |
|
|
u_int i, lines, offset, left, start, width; |
u_int i, lines, offset, left, start, width; |
u_int pcursor, pwidth; |
u_int pcursor, pwidth; |
struct grid_cell gc, cursorgc; |
struct grid_cell gc, cursorgc; |
|
struct format_tree *ft; |
|
|
if (c->tty.sx == 0 || c->tty.sy == 0) |
if (c->tty.sx == 0 || c->tty.sy == 0) |
return (0); |
return (0); |
|
|
lines = 1; |
lines = 1; |
screen_init(sl->active, c->tty.sx, lines, 0); |
screen_init(sl->active, c->tty.sx, lines, 0); |
|
|
|
ft = format_create_defaults(NULL, c, NULL, NULL, NULL); |
if (c->prompt_mode == PROMPT_COMMAND) |
if (c->prompt_mode == PROMPT_COMMAND) |
style_apply(&gc, s->options, "message-command-style", NULL); |
style_apply(&gc, s->options, "message-command-style", ft); |
else |
else |
style_apply(&gc, s->options, "message-style", NULL); |
style_apply(&gc, s->options, "message-style", ft); |
|
format_free(ft); |
|
|
memcpy(&cursorgc, &gc, sizeof cursorgc); |
memcpy(&cursorgc, &gc, sizeof cursorgc); |
cursorgc.attr ^= GRID_ATTR_REVERSE; |
cursorgc.attr ^= GRID_ATTR_REVERSE; |