From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lndn.lancelotsix.com (lndn.lancelotsix.com [51.195.220.111]) by sourceware.org (Postfix) with ESMTPS id 517583858C30 for ; Thu, 2 Feb 2023 09:33:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 517583858C30 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=lancelotsix.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=lancelotsix.com Received: from ubuntu.lan (unknown [IPv6:2a02:390:9086::146]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id D24E8806E7; Thu, 2 Feb 2023 09:33:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=lancelotsix.com; s=2021; t=1675330409; bh=YyhMp6pfB/1t3u8F1pjCMVgFK4Taoz1aXvSABvAVmJY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=yDw1ijC5YXpHriRDJdaMXvQwz4ejbzzOj373WY6gI37Euh++J3t2dXp64Jtiy7rI8 uCDkNaBVuK6L86Zyi5fHkC8dRmISt9QgmiPaE1VhvpDggQ7XSyfn2Z2/VhSP0yWEGZ c6ybKH/2ZW5txFihvKvWTsbL1fYjFsFUDiMZ0b4R9qXcAM00e/piyEP5F8+Pv+8Z+i Ytdf3XtUVDiaCOAAhJmViCk+u2Au0LLn5ezDbphOk1OhHfkPFhyqme1JL0Frb6YHHe vckadyNjVX0C/+MlTHAZ+sh9foduTCqn+Z0LsTCVpMFZQp6+HBoOqGgpBxZ/bDmAmB /fJn1OP5EK/2g== Date: Thu, 2 Feb 2023 09:33:22 +0000 From: Lancelot SIX To: strager Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] gdb/tui: add 'set tui mouse-events off' to restore mouse selection Message-ID: <20230202092950.tpxei5w4meutjeiv@ubuntu.lan> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (lndn.lancelotsix.com [0.0.0.0]); Thu, 02 Feb 2023 09:33:29 +0000 (UTC) X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi, Thanks for working on this! I think I got used to use the "shift" key when I try to select, but soon might soon have "set tui mouse-events off" in my rc file. I have some code formatting remarks: - In GDB codebase, we use tab for indentation[1]: Lines should be indented with a mix of tabs and spaces. 8 spaces should be replaced with Tab. It looks like you patch uses spaces for indentation. -GDB prefers "nullptr" instead of "NULL". I have inlined in the patch below where this is relevant. Otherwise, and for what this is worth (I am not a maintainer), the change looks reasonable to me. Best, Lancelot. [1] https://sourceware.org/gdb/wiki/Internals%20GDB-C-Coding-Standards#Code_indentation > diff --git gdb/tui/tui-win.c gdb/tui/tui-win.c > index 008189eb99b..5709bfcbac1 100644 > --- gdb/tui/tui-win.c > +++ gdb/tui/tui-win.c > @@ -897,6 +897,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) Use tabs here. > +{ > + gdb_printf (file, _("TUI mouse events is %s.\n"), value); > +} > + > /* Set the tab width of the specified window. */ > static void > tui_set_tab_width_command (const char *arg, int from_tty) > @@ -1284,6 +1295,19 @@ position indicator is styled."), > &style_set_list, > &style_show_list); > > + add_setshow_boolean_cmd ("mouse-events", class_tui, > + &tui_enable_mouse, _("\ Same > +Set whether TUI mode handles mouse clicks."), _("\ > +Show whether TUI mode handles mouse clicks."), _("\ > +When on, the TUI will interpret mouse clicks (including scroll wheel > presses),\n\ > +overwriting the terminal's default behavior (usually text selection).\n\ > +When off, the TUI will preserve the terminal's default behavior for mouse\n\ > +events."), > + Extra empty line here could be removed. > + NULL, s/NULL/nullptr/ > + show_tui_mouse_events, > + &tui_setlist, &tui_showlist); and tabs instead of spaces for the above lines. > + > tui_border_style.changed.attach (tui_rehighlight_all, "tui-win"); > tui_active_border_style.changed.attach (tui_rehighlight_all, "tui-win"); > }