Do not use client for copy-mode -S if NULL, reported by Martin Vlach.

This commit is contained in:
nicm
2026-10-02 12:12:51 +00:00
committed by tmux update bot
parent 4a98a9dea8
commit 5932140d30

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: cmd-copy-mode.c,v 1.54 2026/07/14 17:17:17 nicm Exp $ */ /* $OpenBSD: cmd-copy-mode.c,v 1.55 2026/10/02 12:12:51 nicm Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -103,6 +103,8 @@ cmd_copy_mode_exec(struct cmd *self, struct cmdq_item *item)
if (args_has(args, 'd')) if (args_has(args, 'd'))
window_copy_pagedown(wp, 0, args_has(args, 'e')); window_copy_pagedown(wp, 0, args_has(args, 'e'));
if (args_has(args, 'S')) { if (args_has(args, 'S')) {
if (c == NULL)
return (CMD_RETURN_NORMAL);
tty_window_offset(&c->tty, &tty_ox, &tty_oy, &tty_sx, &tty_sy); tty_window_offset(&c->tty, &tty_ox, &tty_oy, &tty_sx, &tty_sy);
window_copy_scroll(wp, c->tty.mouse_slider_mpos, event->m.y, window_copy_scroll(wp, c->tty.mouse_slider_mpos, event->m.y,
tty_oy, args_has(args, 'e')); tty_oy, args_has(args, 'e'));