=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/window-copy.c,v retrieving revision 1.319 retrieving revision 1.320 diff -u -r1.319 -r1.320 --- src/usr.bin/tmux/window-copy.c 2021/03/09 08:24:09 1.319 +++ src/usr.bin/tmux/window-copy.c 2021/03/09 13:07:50 1.320 @@ -1,4 +1,4 @@ -/* $OpenBSD: window-copy.c,v 1.319 2021/03/09 08:24:09 nicm Exp $ */ +/* $OpenBSD: window-copy.c,v 1.320 2021/03/09 13:07:50 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -3366,8 +3366,11 @@ cy = screen_hsize(data->backing) - data->oy + data->cy; if (window_copy_search_mark_at(data, data->cx, cy, &at) != 0) return (NULL); - if (data->searchmark[at] == 0) - return (NULL); + if (data->searchmark[at] == 0) { + /* Allow one position after the match. */ + if (at == 0 || data->searchmark[--at] == 0) + return (NULL); + } window_copy_match_start_end(data, at, &start, &end); /*