Re: [PATCHv3 1/2] Initial TUI mouse support

Pedro Alves
2021-06-04T16:30:16Z

On 2021-06-04 4:20 p.m., Pedro Alves wrote:
> On 2021-06-04 3:21 p.m., Hannes Domani via Gdb-patches wrote:
>> Am Freitag, 4. Juni 2021, 15:51:27 MESZ hat Tom Tromey <tom@tromey.com> Folgendes geschrieben:
>>
>>>>>>>> "Hannes" == Hannes Domani via Gdb-patches <gdb-patches@sourceware.org> writes:
>>>
>>> Hannes> Implements an overridable tui_win_info::click method whose arguments
>>> Hannes> are the mouse coordinates inside the specific window, and the mouse
>>> Hannes> button clicked.
>>>
>>> Hannes> And if the curses implementation supports 5 buttons, the 4th and 5th
>>> Hannes> buttons are used for scrolling.
>>>
>>> Hannes> 2021-06-03  Hannes Domani  <ssbssa@yahoo.de>
>>>
>>> Hannes>     * ser-mingw.c (console_select_thread): Handle MOUSE_EVENT.
>>> Hannes>     * tui/tui-data.h (struct tui_win_info): Add click function.
>>> Hannes>     * tui/tui-io.c (tui_prep_terminal): Enable mouse events.
>>> Hannes>     (tui_deprep_terminal): Disable mouse events.
>>> Hannes>     (tui_dispatch_ctrl_char): Handle KEY_MOUSE.
>>> Hannes>     * tui/tui.c (tui_disable): Disable mouse events.
>>>
>>> Looks good.  Thank you again.
>>
>> Pushed both, thanks.
>>
>
> Yay, mouse support finally. Thank you!

Unfortunately, now that I try it, it's broken for me. And it's broken in a very bad way -- I think
this should block the release or be disabled until we figure out what's wrong. It definitely
makes GDB unusable for me.

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.

Pedro Alves