Sync OpenBSD patchset 976:

Option to change status line (message) background when using vi keys and
in command mode. From Ben Boeckel.
pull/1/head
Tiago Cunha 2011-11-10 21:40:17 +00:00
parent 693c106a1d
commit 21128fea1e
3 changed files with 37 additions and 4 deletions

View File

@ -193,6 +193,21 @@ const struct options_table_entry session_options_table[] = {
.default_num = 3 .default_num = 3
}, },
{ .name = "message-command-attr",
.type = OPTIONS_TABLE_ATTRIBUTES,
.default_num = 0
},
{ .name = "message-command-bg",
.type = OPTIONS_TABLE_COLOUR,
.default_num = 0
},
{ .name = "message-command-fg",
.type = OPTIONS_TABLE_COLOUR,
.default_num = 3
},
{ .name = "message-fg", { .name = "message-fg",
.type = OPTIONS_TABLE_COLOUR, .type = OPTIONS_TABLE_COLOUR,
.default_num = 0 .default_num = 0

View File

@ -919,9 +919,16 @@ status_prompt_redraw(struct client *c)
off = 0; off = 0;
memcpy(&gc, &grid_default_cell, sizeof gc); memcpy(&gc, &grid_default_cell, sizeof gc);
colour_set_fg(&gc, options_get_number(&s->options, "message-fg")); /* Change colours for command mode. */
colour_set_bg(&gc, options_get_number(&s->options, "message-bg")); if (c->prompt_mdata.mode == 1) {
gc.attr |= options_get_number(&s->options, "message-attr"); colour_set_fg(&gc, options_get_number(&s->options, "message-command-fg"));
colour_set_bg(&gc, options_get_number(&s->options, "message-command-bg"));
gc.attr |= options_get_number(&s->options, "message-command-attr");
} else {
colour_set_fg(&gc, options_get_number(&s->options, "message-fg"));
colour_set_bg(&gc, options_get_number(&s->options, "message-bg"));
gc.attr |= options_get_number(&s->options, "message-attr");
}
screen_write_start(&ctx, NULL, &c->status); screen_write_start(&ctx, NULL, &c->status);
@ -977,7 +984,12 @@ status_prompt_key(struct client *c, int key)
c->flags |= CLIENT_STATUS; c->flags |= CLIENT_STATUS;
} }
break; break;
case MODEKEYEDIT_SWITCHMODE:
c->flags |= CLIENT_STATUS;
break;
case MODEKEYEDIT_SWITCHMODEAPPEND: case MODEKEYEDIT_SWITCHMODEAPPEND:
c->flags |= CLIENT_STATUS;
/* FALLTHROUGH */
case MODEKEYEDIT_CURSORRIGHT: case MODEKEYEDIT_CURSORRIGHT:
if (c->prompt_index < size) { if (c->prompt_index < size) {
c->prompt_index++; c->prompt_index++;

8
tmux.1
View File

@ -14,7 +14,7 @@
.\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING .\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
.\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\" .\"
.Dd $Mdocdate: October 27 2011 $ .Dd $Mdocdate: November 5 2011 $
.Dt TMUX 1 .Dt TMUX 1
.Os .Os
.Sh NAME .Sh NAME
@ -1971,6 +1971,12 @@ from the 256-colour set,
or a hexadecimal RGB string such as or a hexadecimal RGB string such as
.Ql #ffffff , .Ql #ffffff ,
which chooses the closest match from the default 256-colour set. which chooses the closest match from the default 256-colour set.
.It Ic message-command-attr Ar attributes
Set status line message attributes when in command mode.
.It Ic message-command-bg Ar colour
Set status line message background colour when in command mode.
.It Ic message-command-fg Ar colour
Set status line message foreground colour when in command mode.
.It Ic message-fg Ar colour .It Ic message-fg Ar colour
Set status line message foreground colour. Set status line message foreground colour.
.It Ic message-limit Ar number .It Ic message-limit Ar number