summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-copy-mode.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/tmux/cmd-copy-mode.c')
-rw-r--r--usr.bin/tmux/cmd-copy-mode.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.bin/tmux/cmd-copy-mode.c b/usr.bin/tmux/cmd-copy-mode.c
index a9110cf87cb..b173d613597 100644
--- a/usr.bin/tmux/cmd-copy-mode.c
+++ b/usr.bin/tmux/cmd-copy-mode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-copy-mode.c,v 1.48 2024/08/26 07:09:34 nicm Exp $ */
+/* $OpenBSD: cmd-copy-mode.c,v 1.49 2024/11/12 09:32:56 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -30,8 +30,8 @@ const struct cmd_entry cmd_copy_mode_entry = {
.name = "copy-mode",
.alias = NULL,
- .args = { "deHMs:t:uq", 0, 0, NULL },
- .usage = "[-deHMuq] [-s src-pane] " CMD_TARGET_PANE_USAGE,
+ .args = { "deHMqSs:t:u", 0, 0, NULL },
+ .usage = "[-deHMqSu] [-s src-pane] " CMD_TARGET_PANE_USAGE,
.source = { 's', CMD_FIND_PANE, 0 },
.target = { 't', CMD_FIND_PANE, 0 },
@@ -92,7 +92,12 @@ cmd_copy_mode_exec(struct cmd *self, struct cmdq_item *item)
if (args_has(args, 'u'))
window_copy_pageup(wp, 0);
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')) {
+ window_copy_scroll(wp, c->tty.mouse_slider_mpos, event->m.y,
+ args_has(args, 'e'));
+ return (CMD_RETURN_NORMAL);
+ }
return (CMD_RETURN_NORMAL);
}