From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id IHt4CpKQumDiTwAAWB0awg (envelope-from ) for ; Fri, 04 Jun 2021 16:44:02 -0400 Received: by simark.ca (Postfix, from userid 112) id 28B551F163; Fri, 4 Jun 2021 16:44:02 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.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 AF0C21E54D for ; Fri, 4 Jun 2021 16:44:01 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CB7D039A141B for ; Fri, 4 Jun 2021 20:44:00 +0000 (GMT) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by sourceware.org (Postfix) with ESMTPS id E864E39A1402 for ; Fri, 4 Jun 2021 20:43:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E864E39A1402 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f51.google.com with SMTP id l2so10520488wrw.6 for ; Fri, 04 Jun 2021 13:43:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ermY0K+ssJEI5EFcZcA9QTVcuraLI61A08T0wXYDy0w=; b=nGJ7CYNakwC6AZPSnSc6Pw0Bn+X1eit9tkLnL88bKHIUJncSVK5PtyHdOPHlL2aR69 DJziMOTCmhQeXTtuJk6M+9wwYolFMX2oCZj6m/SzSAQjVX+gqUVF40gt/WvVs4LwkRpe 3mEfro0sAM1z1KIEtv4wgjihykd5ND1Nhms0oxWAq60aTzH2VgJy866nU8O+dAppuhy/ 8fTKphxG7Oj2f5IB43PhOGNGSV6KPEuGFhUESrJGMzrhL6bj3YLmUFGLj4pvcfZxPPG7 09ZkIwxJzDgSIWmKDextdZYj+pIO0cLw0tyU8jQ/WxVYWGy2WF5LKoRyfCAuo4Gsh/qW ScHQ== X-Gm-Message-State: AOAM530BsNsIlD9e0iBFnH7DIv27eU0j3jguil/T6hJRW7rDGupRUgSj exk5r60MYKDayzxYr0xVqn0= X-Google-Smtp-Source: ABdhPJwabXYf1wfXJFKCuFRT+T+ucbbrp2Tg3IW3OwMkWvFiclX/NKQemwVteiJKVwGMUwuNBktFLA== X-Received: by 2002:a05:6000:22c:: with SMTP id l12mr5560617wrz.329.1622839416942; Fri, 04 Jun 2021 13:43:36 -0700 (PDT) Received: from ?IPv6:2001:8a0:f907:cc00:d853:1a0d:f443:8b26? ([2001:8a0:f907:cc00:d853:1a0d:f443:8b26]) by smtp.gmail.com with ESMTPSA id m132sm6740000wmf.10.2021.06.04.13.43.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Jun 2021 13:43:35 -0700 (PDT) Subject: Re: [PATCHv3 1/2] Initial TUI mouse support From: Pedro Alves To: Simon Marchi , Hannes Domani , Hannes Domani via Gdb-patches , Tom Tromey , Joel Brobecker References: <20210603151453.15248-1-ssbssa.ref@yahoo.de> <20210603151453.15248-1-ssbssa@yahoo.de> <87r1hhoi03.fsf@tromey.com> <1760297979.5212997.1622816480782@mail.yahoo.com> <0936428e-80c4-c192-cdfd-817ff9bcfab0@palves.net> <45415d6f-45f8-c709-5a21-dd2b02e724f3@polymtl.ca> Message-ID: <6e1659e5-3449-c2f8-9190-dadaac4be312@palves.net> Date: Fri, 4 Jun 2021 21:43:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2021-06-04 9:31 p.m., Pedro Alves wrote: > On 2021-06-04 7:13 p.m., Simon Marchi wrote: >> On 2021-06-04 12:29 p.m., Pedro Alves wrote: >>> The trouble is that now pressing anywhere on the screen with the mouse just results in >>> weird characters being printed on the command line window (probably uninterpreted control >>> sequences). That even prevents me from selecting text (something I do often) -- I wanted to do >>> that to paste the results here. I even tried suspending GDB with ^Z to then copy the text, but >>> that still leaves the mouse messed up. See this screenshot: >>> >>> https://i.imgur.com/bO7FKDO.png >>> >>> This was on Ubuntu 20.04. >> >> Obviously the printing random characters is bad. But it's possible that >> the not being able to select text is normal, as the application (GDB) >> now supports mouse events. In some terminal emulators, you can press >> shift while you click to say "I really want to select the display >> characters, not send mouse events to the program". > > I'm on my Fedora 32 laptop currently, and here it works fine. > > You can select text without having press any key. It basically works > as before. Huh, now that I pull+rebuild GDB, I need to press shift to select. And now I'm not sure what I tested anymore. I could definitely scroll the TUI windows before this latest rebuild. Mistyfying... Pedro Alves > I suppose we could teach GDB to be smarter about text selection -- like, > if you select several lines of source code in the TUI source window, ideally > we'd select just the source code, instead of the source code plus the window > borders, etc. Then we would have an "escape" key to be able to disable special > mouse mode so you can select text in the whole terminal using regular text > terminal selection, and I suppose that that's what "shift" does in those programs > you mention. > > I'm surprised to find that clicking a window doesn't set focus on it, though. > Is that supposed to work? > > Pedro Alves > >> >> It's the same with other TUI apps for me: >> >> - tmux (with "set -g mouse on" in ~/.tmux.conf) >> - tig (I don't remember if anything is needed to enable mouse support) >> - weechat (I don't remember if anything is needed to enable mouse >> support) >> >> In some of these programs, mouse support is disabled by default and you >> have to use some setting to enable it. So by default, standard >> selection would work. But if you enable mouse suport, then you have to >> use shift+click to select. >> >> Simon >> >