diff options
Diffstat (limited to 'gdb/tui')
-rw-r--r-- | gdb/tui/tui-io.c | 3 | ||||
-rw-r--r-- | gdb/tui/tui-win.c | 22 | ||||
-rw-r--r-- | gdb/tui/tui-win.h | 3 |
3 files changed, 27 insertions, 1 deletions
diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c index 8cb68d1..b8954af 100644 --- a/gdb/tui/tui-io.c +++ b/gdb/tui/tui-io.c @@ -657,7 +657,8 @@ static void tui_prep_terminal (int notused1) { #ifdef NCURSES_MOUSE_VERSION - mousemask (ALL_MOUSE_EVENTS, NULL); + if (tui_enable_mouse) + mousemask (ALL_MOUSE_EVENTS, NULL); #endif } diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c index 93cf45e..a0a1233 100644 --- a/gdb/tui/tui-win.c +++ b/gdb/tui/tui-win.c @@ -872,6 +872,17 @@ tui_show_compact_source (struct ui_file *file, int from_tty, gdb_printf (file, _("TUI source window compactness is %s.\n"), value); } +bool tui_enable_mouse = true; + +/* Implement 'show tui mouse-events'. */ + +static void +show_tui_mouse_events (struct ui_file *file, int from_tty, + struct cmd_list_element *c, const char *value) +{ + gdb_printf (file, _("TUI mouse events are %s.\n"), value); +} + /* Set the tab width of the specified window. */ static void tui_set_tab_width_command (const char *arg, int from_tty) @@ -1254,6 +1265,17 @@ in a compact form. The compact form uses less horizontal space."), tui_set_compact_source, tui_show_compact_source, &tui_setlist, &tui_showlist); + add_setshow_boolean_cmd ("mouse-events", class_tui, + &tui_enable_mouse, _("\ +Set whether TUI mode handles mouse clicks."), _("\ +Show whether TUI mode handles mouse clicks."), _("\ +When on (default), mouse clicks control the TUI and can be accessed by Python\n\ +extensions. When off, mouse clicks are handled by the terminal, enabling\n\ +terminal-native text selection."), + nullptr, + show_tui_mouse_events, + &tui_setlist, &tui_showlist); + add_setshow_boolean_cmd ("tui-current-position", class_maintenance, &style_tui_current_position, _("\ Set whether to style text highlighted by the TUI's current position indicator."), diff --git a/gdb/tui/tui-win.h b/gdb/tui/tui-win.h index 3d35f1d..c0a7732 100644 --- a/gdb/tui/tui-win.h +++ b/gdb/tui/tui-win.h @@ -51,6 +51,9 @@ struct cmd_list_element **tui_get_cmd_list (void); /* Whether compact source display should be used. */ extern bool compact_source; +/* Whether the TUI should intercept terminal mouse events. */ +extern bool tui_enable_mouse; + /* Whether to style the source and assembly code highlighted by the TUI's current position indicator. */ extern bool style_tui_current_position; |