From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id +O0iKXypxGCkRAAAWB0awg (envelope-from ) for ; Sat, 12 Jun 2021 08:33:00 -0400 Received: by simark.ca (Postfix, from userid 112) id A26AF1F163; Sat, 12 Jun 2021 08:33:00 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 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 68F781E01F for ; Sat, 12 Jun 2021 08:32:59 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A4D493865474 for ; Sat, 12 Jun 2021 12:32:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A4D493865474 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623501178; bh=Qm5gG5LBWC/tjEg7LiqVPLu8YaELIJC9+Biiz1B+dlc=; h=Date:To:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=aaOj2GdbbG53pWT3VpphInKf45yJLMnL+sIeRu2peuxJVhhoTRetztCrqTdz3oc8G AHeWzGzvf9J2LswjyX3gGneuxiOF1ztKq+mVczjatW2fOFYJxyPcNAwObaj8jHD0qc gP2rdODp+4t+0bDVHJ4HBCPAkkvFdGNhnDOnVoGc= Received: from sonic302-20.consmr.mail.ir2.yahoo.com (sonic302-20.consmr.mail.ir2.yahoo.com [87.248.110.83]) by sourceware.org (Postfix) with ESMTPS id 919313857817 for ; Sat, 12 Jun 2021 12:32:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 919313857817 X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1623501148; bh=khr3gJ73Pn20z3c1Zu32DWYG9b4Z2cizocDE9kvtq5A=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=PAf/NL42zBpg9YAYPuQNazAdR/JtPe1qqs3wLdF0Pykqywf18rxIk37ljh9CmjM/i0Uos2pHa9b9FHuBC99L9ubJ/g45xe3tVLCiMKb2PwqNVXA7GETGUqsJv2mrf/IzqaLfxBOFW/A5MxHwi+GSxSaEOhKqVJx53oija8nP1I69wzpC+3+79GVLM9jZfi4lYBTN0e6R1tYMaLqQueA7YlEwnoijwNLpU58Nnpwmgl0BXGbf+q8J4cb0udFg01nU6mtOfBVE0Bq8iK5Zii1kmzR04x6GMK5dgzW6VTGtloUdcHU7LlfaGQuUapuaMzLnv7C1ykjkHFA415kOQRPn9g== X-YMail-OSG: WwN.dgQVM1lcK2PqXlqvZEPUEpUGMydraZF5SxlKERLSd0MWngP0qOw3VcDdn.9 6LrE..2lwVsoqRNZKmrtCvSrz_OCcyEumKB_uNPLj9vAl4MVegg9OjoMvAo0GHh.5N0HuZBCNuhf SyqS_eP3u9YWwcKnRjf2irlURlVWIJbUTM0CvoofG1sHrI5HJK.0B4mbB4AfbJpcC85vGoGXcHfW z090DW1Wix6UDPUNI5cwwwLIOgpaqFdjiqVkXpl0BT1qQaXVqG5iW23JXxFnneND6AF.IV_ond0z wpF8DQgjP66EFnLz3OLID8F2odnGwfm5xI9DPA1Uqab.ppuS9UkkNiXsoQuXQuSeP2xjyr5rlbo4 MPUMyRttDgq4si9R_0HsWdKc3VLNvv3UiM6ztQqIRb9vq7BCieXh7XQohuUXk.WhHFiN5egToQKb uxh5RpfB_1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IVSv053IC4B4wKJ_h_j5k0s04azOV8PZMgz3yvj0BbiK4CDctiImIO 4c01_zjaxGUc9MLt39rgDPmKtK0IpSa3n12a6OFYpnYO2JreoAUDZwU8IDldx6129hakV X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.ir2.yahoo.com with HTTP; Sat, 12 Jun 2021 12:32:28 +0000 Date: Sat, 12 Jun 2021 12:32:25 +0000 (UTC) To: Hannes Domani via Gdb-patches , Tom Tromey , Pedro Alves Message-ID: <1761936332.9225994.1623501145444@mail.yahoo.com> In-Reply-To: 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> Subject: Re: POC: Make the TUI command window support the mouse (Re: [PATCHv3 1/2] Initial TUI mouse support) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailer: WebService/1.1.18368 YMailNorrin 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: Hannes Domani via Gdb-patches Reply-To: Hannes Domani Cc: Joel Brobecker Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Am Samstag, 12. Juni 2021, 04:41:12 MESZ hat Pedro Alves Folgendes geschrieben: > On 2021-06-11 12:02 p.m., Hannes Domani wrote: > >=C2=A0 Am Donnerstag, 10. Juni 2021, 20:47:01 MESZ hat Tom Tromey Folgendes geschrieben: > > > >>>>>>> "Hannes" =3D=3D Hannes Domani via Gdb-patches writes: > >> > >> Hannes> I imagine the same is true for mouse escape sequences. > >> Hannes> So I would just disable the mouse when the command window has = focus, but > >> Hannes> what do you think? > >> > >> I think this is a good fallback to have, but it would be better if we > >> could make it really work somehow.=C2=A0 The problem with doing this i= s that > >> if the command window has focus, then things like clicking in the sour= ce > >> to set a breakpoint will not work. > > > > That would probably mean that keypad also has to be enabled when the > > command window has focus. > > I did a short test where I tried this, but then gdb crashed somewhere i= n > > readline, and I stopped there, because I didn't want to debug readline = code. > > We disable the keypad in the command window because we want to pass all e= scape > sequences to readline, unprocessed by ncurses, so that e.g., up/down navi= gates > the command history, left/right moves the cursor position, etc., just lik= e if > you weren't in the TUI. > > I first thought of fixing this by enabling the keypad, and then where we = handle > KEY_UP, etc., special case the command window, and call readline function= s that do > what you'd expect.=C2=A0 But the thing is that ends up being a poor readl= ine emulation, > and I didn't like where this was going.=C2=A0 Especially when I realized = that for example, > when you're in the middle for a reverse-search (c-r), KEY_UP does somethi= ng different. > Etc. > > I had a different idea to make this all work.=C2=A0 Warning, this is eith= er a brilliant hack, > or a really nasty hack, depending on perspective.=C2=A0 :-) > > The idea is to keep the keypad disabled in the command window.=C2=A0 Howe= ver, > we need to enable the keypad for ncurses to process mouse escape sequence= s. > This is a conflict.=C2=A0 So here's the main trick behind the idea.=C2=A0= It breaks the conflict. > Create a separate ncurses screen/terminal, with newterm, which reads from= a pipe instead > of from stdin.=C2=A0 Then, flush data from stdin into this pipe, BUT, mak= e sure to never flush > a non-mouse escape sequence into the pipe.=C2=A0 It's like the pipe is st= din, but with any > non-mouse escape sequence filtered out.=C2=A0 This way, ncurses only eith= er sees mouse > escape sequences or normal ASCII keys.=C2=A0 In order to do this, we need= to use > a separate thread to flush stdin to the pipe. > > I gave this a try the other weekend, and ran into issues.=C2=A0 Today/ton= ight I gave it > another go, and got it working.=C2=A0 It is a bit rough around the edges,= but > seems to work nicely. If this works on Linux, then that's great, but Windows doesn't send mouse escape sequences. On the other hand, if keypad was enabled, couldn't we just forward readline the escape sequences for the arrow keys instead? Hannes