From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id EgyMHITfxWCEBgAAWB0awg (envelope-from ) for ; Sun, 13 Jun 2021 06:35:48 -0400 Received: by simark.ca (Postfix, from userid 112) id 64FC01F163; Sun, 13 Jun 2021 06:35:48 -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.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 404931E54D for ; Sun, 13 Jun 2021 06:35:47 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A39CD3861826 for ; Sun, 13 Jun 2021 10:35:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A39CD3861826 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623580546; bh=sK8fkuAgacfIAB+dqYlZLVcHvE/d450SZibSlJ0ujV8=; h=Date:To:In-Reply-To:Subject:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=xLrHZez5orOKac3qGUoAQaVP4A2m/aqFZzjvXCWk2UrXObwID+Zc/zpENkHg0tjDt ycMEX5DXT9wbnyAO1ZV7EKjfQ8DfdNJECvhMf5S36jEXxY1N4Xk3JpETmgsEdsVIhB c2vq40qTG1fpucdHqZHo0d8bWWFoEphG3igjOjC0= Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id DCFD5385740B for ; Sun, 13 Jun 2021 10:35:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DCFD5385740B Received: from fencepost.gnu.org ([2001:470:142:3::e]:39338) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lsNSe-0006Pn-Je; Sun, 13 Jun 2021 06:35:24 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2948 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 1lsNSe-0004Ak-7F; Sun, 13 Jun 2021 06:35:24 -0400 Date: Sun, 13 Jun 2021 13:35:17 +0300 Message-Id: <83o8ca6oii.fsf@gnu.org> To: Pedro Alves In-Reply-To: <455337ea-65c3-42b5-0ec0-3c85b85ba054@palves.net> (message from Pedro Alves on Sun, 13 Jun 2021 03:46:13 +0100) Subject: Re: [PATCH v2] Make the TUI command window support the mouse 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> 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 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" > 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?