From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id /LyoBoSD22Pi8ScAWB0awg (envelope-from ) for ; Thu, 02 Feb 2023 04:33:56 -0500 Received: by simark.ca (Postfix, from userid 112) id 0B6FD1E128; Thu, 2 Feb 2023 04:33:56 -0500 (EST) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=DeGX/JWK; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 206511E0D3 for ; Thu, 2 Feb 2023 04:33:55 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AEAE838582B7 for ; Thu, 2 Feb 2023 09:33:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AEAE838582B7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675330433; bh=c1I6Spnl8QyTSYF9/eFjG7CovpGd8dw1X4p5IWegkC0=; h=Date:To:Cc:Subject:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=DeGX/JWKwuWAMGMsWXrV5rT5aAfAv0i3dPo7dlX6O5T7DWkSdXz2RwDC92XkHFj8v SXKMY1CB9Os20K2JrTbvmqDyipqboZvmgqlccLv6hEh696WahUy1XpQfmjVsFYYR2V RnLCplDki3xv+wBCPwiYXIo14bgcY3ssxJnExNGA= 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 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) Date: Thu, 2 Feb 2023 09:33:22 +0000 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-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Lancelot SIX via Gdb-patches Reply-To: Lancelot SIX Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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"); > }