From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 96OgAKVAxmDuJAAAWB0awg (envelope-from ) for ; Sun, 13 Jun 2021 13:30:13 -0400 Received: by simark.ca (Postfix, from userid 112) id E854B1F163; Sun, 13 Jun 2021 13:30:12 -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=ham 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 0A7091E01F for ; Sun, 13 Jun 2021 13:30:12 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BF64C388A40A for ; Sun, 13 Jun 2021 17:30:11 +0000 (GMT) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by sourceware.org (Postfix) with ESMTPS id 3771C3857004 for ; Sun, 13 Jun 2021 17:30:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3771C3857004 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-f45.google.com with SMTP id o3so11796233wri.8 for ; Sun, 13 Jun 2021 10:30:01 -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:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=EsBquJeVceTLQn/F2OvA1BLwtx/mV/t+o3oAc5j9G+4=; b=c3PmNPvMIX/04d45T1TS7XWoPHnpWU39EL2qWpCnZOQW2e/TXC2mxp2Xb/awAIcAe+ t67etLCAZF2Gyqo4gFK/w+niI50EVcfCnqDLdqM6l2KA4/oYBa5WHeBZj+PmTbyCxIsn 9LjFD41+NiBmOHa+wTc8uOrNy4umFWiG/0UQlH3ej519vmREswlpkZM1pu/LdGyw64k6 mVlNg2TdUMYVtyqMAcbuSCw8fKAWZ6kA8KtyEnbjr9JUkqXV/y6ZEpR2wl9cTdyXTx4C L1a+z79geG9BC/TO6H/vSAiPK2MnHATU7tlrqQZPxfcj1J0ktJSfS6ImjKJueEVHbh7n SwAw== X-Gm-Message-State: AOAM530kOSzk2TxoZ18y2wB2UBNJhqeJQMdrKjDwwWRWB8xryeGdV/Qv yj2xhohrjomJUznUupkfMlw= X-Google-Smtp-Source: ABdhPJwlWjEEDmVqNnyxrwdLge+tVA0EJDGWxqAXBOrx5TqoUiBbuAlb4U0U5ag2+3YvLpRTJKjKuQ== X-Received: by 2002:a5d:540a:: with SMTP id g10mr14865211wrv.254.1623605400296; Sun, 13 Jun 2021 10:30:00 -0700 (PDT) Received: from ?IPv6:2001:8a0:f932:6a00:6b6e:c7b6:c5a7:aac3? ([2001:8a0:f932:6a00:6b6e:c7b6:c5a7:aac3]) by smtp.gmail.com with ESMTPSA id q20sm17735864wrf.45.2021.06.13.10.29.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Jun 2021 10:29:59 -0700 (PDT) Subject: Re: [PATCH v2] Make the TUI command window support the mouse From: Pedro Alves To: Eli Zaretskii 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> <877dj9o4ch.fsf@tromey.com> <3facd73a-bfea-d46c-85a7-101ea893998f@palves.net> <8cfc78b7-ecdc-b435-5c1f-f027c8704f9e@palves.net> <1231900744.5510610.1622904017896@mail.yahoo.com> <87wnr1h80t.fsf@tromey.com> <287323544.8784317.1623409369460@mail.yahoo.com> <1761936332.9225994.1623501145444@mail.yahoo.com> <6afbe909-91d6-af32-d496-ca112dcfb43a@palves.net> <455337ea-65c3-42b5-0ec0-3c85b85ba054@palves.net> <83o8ca6oii.fsf@gnu.org> Message-ID: <3fd0ca96-28a8-b909-1bf2-033dbc00548a@palves.net> Date: Sun, 13 Jun 2021 18:29:57 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <83o8ca6oii.fsf@gnu.org> 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: , Cc: tom@tromey.com, gdb-patches@sourceware.org, brobecker@adacore.com Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2021-06-13 11:35 a.m., Eli Zaretskii wrote: >> From: Pedro Alves >> Date: Sun, 13 Jun 2021 03:46:13 +0100 >> Cc: Joel Brobecker >> >> On 2021-06-12 7:08 p.m., Pedro Alves wrote: >>> On 2021-06-12 1:32 p.m., Hannes Domani wrote: >> >>>> On the other hand, if keypad was enabled, couldn't we just forward readline >>>> the escape sequences for the arrow keys instead? >>> >>> Yeah, to be honest I think that is likely a better approach and worth it of a >>> try -- my only concern is whether the escape sequences are standard enough >>> across terminals? Maybe it's all covered by ANSI and it's all we need to care >>> about? I thought of the other approach because that let's us not care about >>> specific sequences, other than the mouse sequence, which seemed pretty much >>> standard from looking around. Also, it was run to write. :-) >>> >> >> Alright, I gave that approach a go. Below's a patch implementing that. It >> works quite nicely here. I tried it on konsole, xterm and rxvt. Among those, >> rxvt uses different escape sequences for ctrl-up/ctrl-down/ctrl-left/ctrl-right, >> but it doesn't really matter -- I found that readline binds actions to >> different variants of escape sequences, so if we pick sequences readline always binds, >> it should always work. See readline.c:bind_arrow_keys_internal. >> Despite that, for the standard ncurses keys below KEY_MAX, it's easier >> to use the corresponding lowercase key_foo variable, which I believe is >> filled in from termcap so should also always work, as readline also >> binds the key sequences termcap returns. > > Maybe I'm missing something, but what about MS-Windows, where the > cursor motion keys don't (AFAIK) generate escape sequences? AFAICT, readline processes the escape sequences we're passing it anyhow, since it unconditionally registers/binds them. It seems to be working for Hannes. Pedro Alves