Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Hannes Domani via Gdb-patches <gdb-patches@sourceware.org>
To: Tom Tromey <tom@tromey.com>, Pedro Alves <pedro@palves.net>
Cc: Joel Brobecker <brobecker@adacore.com>,
	Hannes Domani via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCHv3 1/2] Initial TUI mouse support
Date: Sat, 5 Jun 2021 14:40:17 +0000 (UTC)	[thread overview]
Message-ID: <1231900744.5510610.1622904017896@mail.yahoo.com> (raw)
In-Reply-To: <8cfc78b7-ecdc-b435-5c1f-f027c8704f9e@palves.net>

 Am Samstag, 5. Juni 2021, 01:48:38 MESZ hat Pedro Alves <pedro@palves.net> Folgendes geschrieben:

> On 2021-06-04 9:54 p.m., Pedro Alves wrote:
> > On 2021-06-04 7:46 p.m., Tom Tromey wrote:
> >> Pedro> The trouble is that now pressing anywhere on the screen with the
> >> Pedro> mouse just results in weird characters being printed on the
> >> Pedro> command line window (probably uninterpreted control sequences).
> >>
> >> I tried it here, and it worked fine for me.
> >>
> >> I couldn't select text, but I didn't see any control characters.
> >>
> >> Pedro> This was on Ubuntu 20.04.
> >>
> >> I'm on Fedora 32.
> >
> > I'm currently on Fedora 32 too, and while it works here too, I just found a way to reproduce a similar
> > problem that I'm seeing on the Ubuntu machine (which I currently don't have access to).  (Though
> > on Ubuntu it was worse.)
> >
> > Try this:
> >
> > $ ./gdb ./gdb
> > ...
> > (gdb) start
> > c-x a
> > scroll up and down with mouse to check that it works ok.
> > c-x o # select command window
> > scroll up and down with mouse, and see escape codes being printed on the command window
> >
> > If I "c-x o" again to select the source window, then scrolling works correctly again.
> >
> > If I "c-x o" again to select the command window, then scrolling and clicking with the mouse
> > prints more bad characters.  Like these:
> >
> > (top-gdb) 64;40;21M64;40;21M65;40;21M65;40;21M64;40;21M64;40;21M64;40;21M65;40;21M0;67;32M0;67;32m0;64;18M0;64;18m0;64;18M0;64;18m2;64;18M2;64;18m0;64;18M0;64;18M0;64;18M0
> > ;64;18m1;64;18M1;64;18m64;64;18M64;64;18M1;64;19M1;64;19m1;64;19M1;64;19m2;64;19M2;64;19m0;64;19M0;64;19m0;51;13M0;51;13m0;1;27M0;1;27M0;1;27M0;1;27M0;1;27M0;1;27M0;1;27M0
> > ;1;27M0;1;27M0;1;27m
>
> I have access to the Ubuntu machine again now.  The symptom I see now the same as on Fedora -- I can scroll
> the source window, when when I focus on the command window, I start seeing all the badness.  I don't think
> I focused on the command window earlier when I first reported it, maybe there's some other way to trigger
> it, but can't say for sure.  So it is looking like this isn't OS specific afterall.
>
> Sorry for the spotty reporting.  Hopefully the reproducer helps identifying the issue.

On Windows I can mostly reproduce this, when the command window has focus,
mouse scrolling just doesn't work.
I don't see any escape sequences, because the Windows console works different.
I probably wouldn't have noticed this for a long time, because I never set
the focus to the command window (I always wondered why this is possible at all).

Anyways, I think this happens because when the command window gets focus,
we disable the curses keypad.
As the docu says:

  The keypad option enables the keypad of the user's terminal. If enabled
  (bf is TRUE), the user can press a function key (such as an arrow key) and
  wgetch returns a single value representing the function key, as in KEY_LEFT.
  If disabled (bf is FALSE), curses does not treat function keys specially
  and the program has to interpret the escape sequences itself.

I imagine the same is true for mouse escape sequences.
So I would just disable the mouse when the command window has focus, but
what do you think?


Hannes

  reply	other threads:[~2021-06-05 14:40 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210603151453.15248-1-ssbssa.ref@yahoo.de>
2021-06-03 15:14 ` Hannes Domani via Gdb-patches
2021-06-03 15:14   ` [PATCHv3 2/2] Forward mouse click to python TUI window Hannes Domani via Gdb-patches
2021-06-03 17:16     ` Eli Zaretskii via Gdb-patches
2021-06-04 13:52     ` Tom Tromey
2021-06-04 13:51   ` [PATCHv3 1/2] Initial TUI mouse support Tom Tromey
2021-06-04 14:21     ` Hannes Domani via Gdb-patches
2021-06-04 15:20       ` Pedro Alves
2021-06-04 16:06         ` Hannes Domani via Gdb-patches
2021-06-04 16:23           ` Pedro Alves
2021-06-04 18:59             ` Eli Zaretskii via Gdb-patches
2021-06-04 18:57           ` Eli Zaretskii via Gdb-patches
2021-06-04 16:29         ` Pedro Alves
2021-06-04 16:48           ` Hannes Domani via Gdb-patches
2021-06-04 18:05             ` Joel Brobecker
2021-06-04 18:13           ` Simon Marchi via Gdb-patches
2021-06-04 18:39             ` Joel Brobecker
2021-06-04 20:31             ` Pedro Alves
2021-06-04 20:43               ` Pedro Alves
2021-06-04 21:15               ` Hannes Domani via Gdb-patches
2021-06-04 22:19                 ` Pedro Alves
2021-06-10 18:44               ` Tom Tromey
2021-06-13 17:26                 ` Pedro Alves
2021-06-18 15:01                   ` Tom Tromey
2021-06-18 17:42                     ` Pedro Alves
2021-06-04 18:46           ` Tom Tromey
2021-06-04 20:54             ` Pedro Alves
2021-06-04 23:48               ` Pedro Alves
2021-06-05 14:40                 ` Hannes Domani via Gdb-patches [this message]
2021-06-06  5:46                   ` Eli Zaretskii via Gdb-patches
2021-06-10 18:46                   ` Tom Tromey
2021-06-11 11:02                     ` Hannes Domani via Gdb-patches
2021-06-12  2:41                       ` POC: Make the TUI command window support the mouse (Re: [PATCHv3 1/2] Initial TUI mouse support) Pedro Alves
2021-06-12 12:32                         ` Hannes Domani via Gdb-patches
2021-06-12 18:08                           ` Pedro Alves
2021-06-13  2:46                             ` [PATCH v2] Make the TUI command window support the mouse Pedro Alves
2021-06-13 10:35                               ` Eli Zaretskii via Gdb-patches
2021-06-13 17:29                                 ` Pedro Alves
2021-06-13 18:02                                   ` Eli Zaretskii via Gdb-patches
2021-06-13 18:13                                     ` Pedro Alves
2021-06-13 13:04                               ` Hannes Domani via Gdb-patches
2021-06-13 17:25                                 ` [PATCH v3] " Pedro Alves
2021-06-13 17:55                                   ` Hannes Domani via Gdb-patches
2021-06-13 17:59                                     ` Pedro Alves
2021-06-17 11:04                                       ` [PUSHED v4] " Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1231900744.5510610.1622904017896@mail.yahoo.com \
    --to=gdb-patches@sourceware.org \
    --cc=brobecker@adacore.com \
    --cc=pedro@palves.net \
    --cc=ssbssa@yahoo.de \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox