diff --git a/mode-tree.c b/mode-tree.c index f6e3eb75b..06001a672 100644 --- a/mode-tree.c +++ b/mode-tree.c @@ -832,6 +832,7 @@ mode_tree_draw(struct mode_tree_data *mtd) const char *tag, *separator; size_t n; int keylen, alignlen[mtd->maxdepth + 1]; + int dfg, dfg0; if (mtd->line_size == 0) return; @@ -842,6 +843,9 @@ mode_tree_draw(struct mode_tree_data *mtd) memcpy(&box_gc, &grid_default_cell, sizeof box_gc); style_apply(&box_gc, oo, "tree-mode-border-style", NULL); + dfg = gc.fg; + dfg0 = gc0.fg; + w = mtd->width; h = mtd->height; @@ -927,8 +931,8 @@ mode_tree_draw(struct mode_tree_data *mtd) width = prefix_width + text_width; if (mti->tagged) { - gc.attr ^= GRID_ATTR_BRIGHT; - gc0.attr ^= GRID_ATTR_BRIGHT; + gc.fg = COLOUR_THEME_CYAN|COLOUR_FLAG_THEME; + gc0.fg = COLOUR_THEME_CYAN|COLOUR_FLAG_THEME; } if (i != mtd->current) { @@ -965,8 +969,8 @@ mode_tree_draw(struct mode_tree_data *mtd) free(prefix); if (mti->tagged) { - gc.attr ^= GRID_ATTR_BRIGHT; - gc0.attr ^= GRID_ATTR_BRIGHT; + gc.fg = dfg; + gc0.fg = dfg0; } } format_free(ft); diff --git a/options-table.c b/options-table.c index d47bd03ca..b9ae14970 100644 --- a/options-table.c +++ b/options-table.c @@ -274,6 +274,7 @@ const struct options_name_map options_other_names[] = { { "clock-mode-color", "clock-mode-colour" }, { "cursor-color", "cursor-colour" }, { "prompt-cursor-color", "prompt-cursor-colour" }, + { "prompt-command-cursor-color", "prompt-command-cursor-colour" }, { "pane-colors", "pane-colours" }, { NULL, NULL } }; @@ -586,7 +587,7 @@ const struct options_table_entry options_table[] = { .type = OPTIONS_TABLE_STRING, .scope = OPTIONS_TABLE_SERVER, .flags = OPTIONS_TABLE_IS_COLOUR, - .default_str = "#{?#{e|>=:#{client_colours},256},darkseagreen,green}", + .default_str = "#{?#{e|>=:#{client_colours},256},yellowgreen,green}", .text = "Dark theme colour for green." }, @@ -1173,6 +1174,15 @@ const struct options_table_entry options_table[] = { .text = "Colour of the cursor when in the command prompt." }, + { .name = "prompt-command-cursor-colour", + .type = OPTIONS_TABLE_STRING, + .scope = OPTIONS_TABLE_SESSION, + .flags = OPTIONS_TABLE_IS_COLOUR, + .default_str = "", + .text = "Colour of the cursor in the command prompt when in command " + "mode, if 'status-keys' is set to 'vi'." + }, + { .name = "prompt-cursor-style", .type = OPTIONS_TABLE_CHOICE, .scope = OPTIONS_TABLE_SESSION, diff --git a/prompt.c b/prompt.c index 57e267374..4612a2e5f 100644 --- a/prompt.c +++ b/prompt.c @@ -45,6 +45,7 @@ struct prompt { enum screen_cursor_style cstyle; enum screen_cursor_style command_cstyle; int ccolour; + int command_ccolour; int cmode; int command_cmode; @@ -123,6 +124,8 @@ prompt_set_options(struct prompt_create_data *pd, struct session *s) screen_set_cursor_style(n, &pd->command_cstyle, &pd->command_cmode); style_apply(&gc, oo, "prompt-cursor-colour", NULL); pd->ccolour = gc.fg; + style_apply(&gc, oo, "prompt-command-cursor-colour", NULL); + pd->command_ccolour = gc.fg; pd->message_format = options_get_string(oo, "message-format"); pd->keys = options_get_number(oo, "status-keys"); pd->word_separators = options_get_string(oo, "word-separators"); @@ -177,6 +180,7 @@ prompt_create(const struct prompt_create_data *pd) pr->cstyle = pd->cstyle; pr->command_cstyle = pd->command_cstyle; pr->ccolour = pd->ccolour; + pr->command_ccolour = pd->command_ccolour; pr->cmode = pd->cmode; pr->command_cmode = pd->command_cmode; pr->message_format = xstrdup(pd->message_format); @@ -466,12 +470,13 @@ prompt_draw(struct prompt *pr, struct prompt_draw_data *pd) memcpy(&gc, &pr->command_style, sizeof gc); s->default_cstyle = pr->command_cstyle; s->default_mode = pr->command_cmode; + s->default_ccolour = pr->command_ccolour; } else { memcpy(&gc, &pr->style, sizeof gc); s->default_cstyle = pr->cstyle; s->default_mode = pr->cmode; + s->default_ccolour = pr->ccolour; } - s->default_ccolour = pr->ccolour; expanded = prompt_expand(pr); start = format_width(expanded); diff --git a/tmux.1 b/tmux.1 index 4cc1ca335..25ed0f221 100644 --- a/tmux.1 +++ b/tmux.1 @@ -5249,14 +5249,19 @@ is input before dismissing it. Can be set to zero to disable any timeout. .It Ic prompt\-cursor\-colour Ar colour Set the colour of the cursor in the command prompt. +.It Ic prompt\-command\-cursor\-colour Ar colour +Set the colour of the cursor in the command prompt when +.Xr vi 1 +keys are enabled and the prompt is in command mode. .It Ic prompt\-cursor\-style Ar style Set the style of the cursor in the command prompt. See the .Ic cursor\-style options for available styles. .It Ic prompt\-command\-cursor\-style Ar style -Set the style of the cursor in the command prompt when vi keys are enabled and -the prompt is in command mode. +Set the style of the cursor in the command prompt when +.Xr vi 1 +keys are enabled and the prompt is in command mode. See the .Ic cursor\-style options for available styles. diff --git a/tmux.h b/tmux.h index 266cf9c7a..c6ddaf6e7 100644 --- a/tmux.h +++ b/tmux.h @@ -2068,6 +2068,7 @@ struct prompt_create_data { enum screen_cursor_style cstyle; enum screen_cursor_style command_cstyle; int ccolour; + int command_ccolour; int cmode; int command_cmode; const char *message_format; diff --git a/tty.c b/tty.c index fa1b45076..ce5012191 100644 --- a/tty.c +++ b/tty.c @@ -748,8 +748,10 @@ tty_force_cursor_colour(struct tty *tty, int c) u_char r, g, b; char s[13]; - if (c != -1) + if (c != -1) { + c = tty_map_theme_colour(tty, c); c = colour_force_rgb(c); + } if (c == tty->ccolour) return; if (c == -1) diff --git a/window-tree.c b/window-tree.c index 31cef5dca..59e41122b 100644 --- a/window-tree.c +++ b/window-tree.c @@ -38,11 +38,11 @@ static void window_tree_key(struct window_mode_entry *, #define WINDOW_TREE_DEFAULT_FORMAT \ "#{?pane_format," \ - "#{?pane_marked,#[reverse],}#{?pane_floating_flag,#[italics],}" \ + "#{?pane_marked,#[fg=thememagenta],}#{?pane_floating_flag,#[underscore],}" \ "#{pane_current_command}#[fg=themelightgrey]#{pane_flags}" \ "#{?#{&&:#{pane_title},#{!=:#{pane_title},#{host_short}}},: \"#{pane_title}\",}" \ ",window_format," \ - "#{?window_marked_flag,#[reverse],}" \ + "#{?window_marked_flag,#[fg=thememagenta],}" \ "#{window_name}#[fg=themelightgrey]#{window_flags}" \ "#{?#{&&:#{==:#{window_panes},1},#{&&:#{pane_title},#{!=:#{pane_title},#{host_short}}}},: \"#{pane_title}\",}" \ "," \