-/* $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>
.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 ...",
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)
-.\" $OpenBSD: tmux.1,v 1.938 2024/03/21 11:32:49 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.939 2024/03/21 11:51:32 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
.\"
.Ql y .
.Tg menu
.It Xo Ic display-menu
-.Op Fl O
+.Op Fl OM
.Op Fl b Ar border-lines
.Op Fl c Ar target-client
.Op Fl C Ar starting-choice
released without an item selected the menu is not closed and a mouse button
must be clicked to choose an item.
.Pp
-The following keys are also available:
+.Fl M
+tells
+.Nm
+the menu should handle mouse events; by default only menus opened from mouse
+key bindings do so.
+.Pp
+The following keys are available in menus:
.Bl -column "Key" "Function" -offset indent
.It Sy "Key" Ta Sy "Function"
.It Li "Enter" Ta "Choose selected item"