=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/window-copy.c,v retrieving revision 1.335 retrieving revision 1.336 diff -c -r1.335 -r1.336 *** src/usr.bin/tmux/window-copy.c 2022/06/09 09:12:55 1.335 --- src/usr.bin/tmux/window-copy.c 2022/06/21 09:30:01 1.336 *************** *** 1,4 **** ! /* $OpenBSD: window-copy.c,v 1.335 2022/06/09 09:12:55 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: window-copy.c,v 1.336 2022/06/21 09:30:01 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 4092,4099 **** struct window_copy_mode_data *data = wme->data; struct screen *s = &data->screen; struct options *oo = wp->window->options; struct grid_cell gc, mgc, cgc, mkgc; ! char hdr[512]; size_t size = 0; u_int hsize = screen_hsize(data->backing); --- 4092,4100 ---- struct window_copy_mode_data *data = wme->data; struct screen *s = &data->screen; struct options *oo = wp->window->options; + struct grid_line *gl; struct grid_cell gc, mgc, cgc, mkgc; ! char hdr[512], tmp[256], *t; size_t size = 0; u_int hsize = screen_hsize(data->backing); *************** *** 4107,4129 **** mkgc.flags |= GRID_FLAG_NOPALETTE; if (py == 0 && s->rupper < s->rlower && !data->hide_position) { if (data->searchmark == NULL) { if (data->timeout) { size = xsnprintf(hdr, sizeof hdr, ! "(timed out) [%u/%u]", data->oy, hsize); ! } else { ! size = xsnprintf(hdr, sizeof hdr, ! "[%u/%u]", data->oy, hsize); ! } } else { ! if (data->searchcount == -1) { size = xsnprintf(hdr, sizeof hdr, ! "[%u/%u]", data->oy, hsize); ! } else { ! size = xsnprintf(hdr, sizeof hdr, ! "(%d%s results) [%u/%u]", data->searchcount, ! data->searchmore ? "+" : "", data->oy, ! hsize); } } if (size > screen_size_x(s)) --- 4108,4136 ---- mkgc.flags |= GRID_FLAG_NOPALETTE; if (py == 0 && s->rupper < s->rlower && !data->hide_position) { + gl = grid_get_line(data->backing->grid, hsize - data->oy); + if (gl->time == 0) + xsnprintf(tmp, sizeof tmp, "[%u/%u]", data->oy, hsize); + else { + t = format_pretty_time(gl->time, 1); + xsnprintf(tmp, sizeof tmp, "%s [%u/%u]", t, data->oy, + hsize); + free(t); + } + if (data->searchmark == NULL) { if (data->timeout) { size = xsnprintf(hdr, sizeof hdr, ! "(timed out) %s", tmp); ! } else ! size = xsnprintf(hdr, sizeof hdr, "%s", tmp); } else { ! if (data->searchcount == -1) ! size = xsnprintf(hdr, sizeof hdr, "%s", tmp); ! else { size = xsnprintf(hdr, sizeof hdr, ! "(%d%s results) %s", data->searchcount, ! data->searchmore ? "+" : "", tmp); } } if (size > screen_size_x(s))