summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-display-menu.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2024-03-21 11:51:33 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2024-03-21 11:51:33 +0000
commiteaca46646b34ad5c0f8fd3a87cfb41cc7e0be566 (patch)
treebd4a791fbf464cb6ac96615a3558383d37b64e6b /usr.bin/tmux/cmd-display-menu.c
parent972cb339d5346146bc9f3f247d7bcac55afd2e67 (diff)
Add -M to always turn mouse on in a menu, GitHub issue 3779.
Diffstat (limited to 'usr.bin/tmux/cmd-display-menu.c')
-rw-r--r--usr.bin/tmux/cmd-display-menu.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/tmux/cmd-display-menu.c b/usr.bin/tmux/cmd-display-menu.c
index 5f0a011e5d4..23887390cff 100644
--- a/usr.bin/tmux/cmd-display-menu.c
+++ b/usr.bin/tmux/cmd-display-menu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-display-menu.c,v 1.42 2023/08/15 07:01:47 nicm Exp $ */
+/* $OpenBSD: cmd-display-menu.c,v 1.43 2024/03/21 11:51:32 nicm Exp $ */
/*
* Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -39,8 +39,8 @@ const struct cmd_entry cmd_display_menu_entry = {
.name = "display-menu",
.alias = "menu",
- .args = { "b:c:C:H:s:S:Ot:T:x:y:", 1, -1, cmd_display_menu_args_parse },
- .usage = "[-O] [-b border-lines] [-c target-client] "
+ .args = { "b:c:C:H:s:S:MOt:T:x:y:", 1, -1, cmd_display_menu_args_parse },
+ .usage = "[-MO] [-b border-lines] [-c target-client] "
"[-C starting-choice] [-H selected-style] [-s style] "
"[-S border-style] " CMD_TARGET_PANE_USAGE "[-T title] "
"[-x position] [-y position] name key command ...",
@@ -374,7 +374,7 @@ cmd_display_menu_exec(struct cmd *self, struct cmdq_item *item)
if (args_has(args, 'O'))
flags |= MENU_STAYOPEN;
- if (!event->m.valid)
+ if (!event->m.valid && !args_has(args, 'M'))
flags |= MENU_NOMOUSE;
if (menu_display(menu, flags, starting_choice, item, px, py, tc, lines,
style, selected_style, border_style, target, NULL, NULL) != 0)