From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id hdZEG4fe1GN3eSMAWB0awg (envelope-from ) for ; Sat, 28 Jan 2023 03:36:23 -0500 Received: by simark.ca (Postfix, from userid 112) id 63D771E128; Sat, 28 Jan 2023 03:36:23 -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=xdebwWZ8; 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 0A66E1E0D3 for ; Sat, 28 Jan 2023 03:36:23 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 021523858C2C for ; Sat, 28 Jan 2023 08:36:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 021523858C2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1674894982; bh=uXobN/MsAKBKsjWxaU5ZS8xZ6khiUjei5DAQK8EcM1Y=; h=Date:To:Cc:In-Reply-To:Subject:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=xdebwWZ8OVjlbXKj1OzC5Y6I7FyNPPXdSkexZyr/KrsA9S0tWRontxvRj6wE1g2Dv /dSxNKwQ1JggbJ+1+Tz256qHlStA5GGad4Q3DQvtaoOYmb2mFJjbXPjd6kM9Ki0TIO qKIzW2nGc/7gKH6ZlVWq0KMn8vW49//D54nI8diI= Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 084063858D28 for ; Sat, 28 Jan 2023 08:35:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 084063858D28 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pLggg-0003Bf-8D; Sat, 28 Jan 2023 03:35:50 -0500 Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pLggf-0002Sf-Gz; Sat, 28 Jan 2023 03:35:49 -0500 Date: Sat, 28 Jan 2023 10:35:38 +0200 Message-Id: <838rhnawf9.fsf@gnu.org> To: strager Cc: gdb-patches@sourceware.org In-Reply-To: (message from strager via Gdb-patches on Fri, 27 Jan 2023 16:42:58 -0800) Subject: Re: [PATCH] gdb/tui: add 'set tui mouse-events off' to restore mouse selection References: 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: Eli Zaretskii via Gdb-patches Reply-To: Eli Zaretskii Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" > Date: Fri, 27 Jan 2023 16:42:58 -0800 > From: strager via Gdb-patches > > Rationale: > I use the mouse with my terminal to select and copy text. In gdb, I use > the mouse to select a function name to set a breakpoint, or a variable > name to print, for example. > > When gdb is compiled with ncurses mouse support, gdb's TUI mode > intercepts mouse events. Left-clicking and dragging, which would > normally select text, seems to do nothing. This means I cannot select > text using my mouse anymore. This makes it harder to set breakpoints, > print variables, etc. > > Solution: > I tried to fix this issue by editing the 'mousemask' call to only enable > buttons 4 and 5. However, this still caused my terminal (gnome-terminal) > to not allow text to be selected. The only way I could make it work is > by calling 'mousemask (0, NULL);'. But doing so disables the mouse code > entirely, which other people might want. > > I therefore decided to make a setting in gdb called 'tui mouse-events'. > If enabled (the default), the behavior is as it is now: terminal mouse > events are given to gdb, disabling the terminal's default behavior. > If disabled (opt-in), the behavior is as it was before the year 2020: > terminal mouse events are not given to gdb, therefore the mouse can be > used to select and copy text. Thanks. > --- gdb/NEWS > +++ gdb/NEWS > @@ -17,6 +17,13 @@ maintenance print record-instruction [ N ] > prints how GDB would undo the N-th previous instruction, and if N is > positive, it prints how GDB will redo the N-th following instruction. > > +set tui mouse-events [on|off] > +show tui mouse-events > + When on (default), the TUI will interpret mouse clicks (including > scroll wheel > + presses), overwriting the terminal's default behavior (usually text > + selection). When off, the TUI will preserve the terminal's default behavior > + for mouse events. Instead of talking about overriding the terminal's behavior, this text should say that the mouse events are interpreted either by GDB or by the terminal. > +Set whether the TUI source window is displayed in ``compact'' form. > +The default display uses more space for line numbers and starts the > +source text at the next tab stop; the compact display uses only as > +much space as is needed for the line numbers in the current file, and > +only a single space to separate the line numbers from the source. This part sounds unrelated?