From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id AFGoAdqNumBkTwAAWB0awg (envelope-from ) for ; Fri, 04 Jun 2021 16:32:26 -0400 Received: by simark.ca (Postfix, from userid 112) id 03E5F1F163; Fri, 4 Jun 2021 16:32:26 -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 AF55C1E54D for ; Fri, 4 Jun 2021 16:32:25 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 778FC39A1417 for ; Fri, 4 Jun 2021 20:32:25 +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 5436E39A046A for ; Fri, 4 Jun 2021 20:31:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5436E39A046A 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 f2so10444693wri.11 for ; Fri, 04 Jun 2021 13:31:31 -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=52gd2QfqxppaHuqkNvMvU0znSbKe3QPW7HfzbUwLWs4=; b=gfU5NIqOlJzuhQZZ2yZO/7ydtNkOC7hZWJyTJliR9lV9Qdmp2D3KctQz3noaaAEU54 4hOfwnhlzRi0UDczO02f90tLu737GofyTUDJmU/18CBqirCN8blpMQdOy2MQom5qR7dZ sDPuj4tpfttT8FhKfK82sTk4RBkZYvjMnKNzjx6UbTOFUY0rjSTCLuaV5wuR2nRxYrnT 6XJAiPJGC691aPKBOzV6xcPY7joM/pi7diHpC/FAiklRGYldPOx1g2J7Gf98q+DayrA1 /jeGXiJVTku3yl+l+N6Zz7TWgRlsc/6u6AZQ66XNyS956kqTgxvcpD2a8ZFCzQyS7UmN MdEw== X-Gm-Message-State: AOAM5300PsfTAhhhyMFrVTuHT2romFxQvHQNkkgyrkjhhxX25F9Uyrm3 Qzt6KfYDI/IbSR6roqvvg3U= X-Google-Smtp-Source: ABdhPJxOX8NnRq/Lmu9Ij/dm3TDiNTq0BofuPOREQVGlx+F4ngh64+r0sUrZfk+JOQIvCCTUhzrOzg== X-Received: by 2002:adf:bc02:: with SMTP id s2mr5619191wrg.87.1622838690417; Fri, 04 Jun 2021 13:31:30 -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 t1sm7573934wrx.28.2021.06.04.13.31.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Jun 2021 13:31:29 -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: Date: Fri, 4 Jun 2021 21:31:28 +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: <45415d6f-45f8-c709-5a21-dd2b02e724f3@polymtl.ca> 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 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. 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 >