diff --git a/options-table.c b/options-table.c index 6587634f6..e40553630 100644 --- a/options-table.c +++ b/options-table.c @@ -1388,7 +1388,9 @@ const struct options_table_entry options_table[] = { .type = OPTIONS_TABLE_STRING, .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE, .default_str = "#[align=right]" - "#{?exit_status_present,#[bg=themeyellow](#{exit_status}),}", + "#{?exit_status_present,#[bg=themeyellow]#[fg=themeblack]" + "#{?exit_status_current,#[fg=themewhite],}(#{exit_status})" + "#[bg=themeyellow]#[fg=themeblack],}", .text = "Format of OSC 133 exit status in copy mode." }, diff --git a/tmux.1 b/tmux.1 index c313e7747..e5034a385 100644 --- a/tmux.1 +++ b/tmux.1 @@ -5784,6 +5784,9 @@ The format is expanded with and .Ql exit_status_present , which is set only when the OSC 133 end-of-output marker includes a status. +The +.Ql exit_status_current +format is set when the cursor is on the command line. .Pp .It Ic copy\-mode\-position\-style Ar style Set the style of the position indicator in copy mode. diff --git a/window-copy.c b/window-copy.c index 9dee2d028..9a663e120 100644 --- a/window-copy.c +++ b/window-copy.c @@ -6046,6 +6046,7 @@ window_copy_write_line(struct window_mode_entry *wme, else content_sx = sx; backing_y = hsize - data->oy + py; + current = (py == data->cy); screen_write_cursormove(ctx, 0, py, 0); @@ -6065,7 +6066,6 @@ window_copy_write_line(struct window_mode_entry *wme, style_apply(&cur_ln_gc, oo, "copy-mode-current-line-number-style", ft); cur_ln_gc.flags |= GRID_FLAG_NOPALETTE; - current = (py == data->cy); absolute = backing_y + 1; if (data->lines != NULL && backing_y < data->line_count) absolute = data->lines[backing_y].source_line + 1; @@ -6143,6 +6143,7 @@ window_copy_write_line(struct window_mode_entry *wme, status_line->exit_status_present) { format_add(ft, "exit_status", "%hhu", status_line->exit_status); format_add(ft, "exit_status_present", "1"); + format_add(ft, "exit_status_current", "%d", current); value = options_get_string(oo, "copy-mode-exit-status-format"); if (*value != '\0') { exit_status = format_expand(ft, value);