Re: [PATCH v2] Make the TUI command window support the mouse

Pedro Alves
2021-06-13T18:13:40Z

On 2021-06-13 7:02 p.m., Eli Zaretskii wrote:
>> From: Pedro Alves <pedro@palves.net>
>> Cc: ssbssa@yahoo.de, gdb-patches@sourceware.org, tom@tromey.com,
>> brobecker@adacore.com
>> Date: Sun, 13 Jun 2021 18:29:57 +0100
>>
>>> 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.
>
> AFAIR, Hannes uses PDCurses, not ncurses, and I don't know what that
> means for this particular issue. I didn't try building GDB after
> these changes, but if someone succeeded building with ncurses and
> running this code on Windows, then I'm happy, of course.
>

Note we're feeding readline the escape sequences when it reads
input (which ends up in a callback in the tui to return the next character
out of stdin), not expecting to see those escape sequences directly out of stdin.
I don't think the curses library readline is linked with will make a difference, since
it's readline that processes the escape codes we feed it, not the curses library. readline
uses the curses library as a way to access termcap (if linked that way), in order to
bind _other_ escape sequences. The sequences we're passing to readline are always bound
by readline without consulting termcap, they're hardcoded as in "readline always recognizes
these escape sequences". It won't hurt to test it, of course.

Pedro Alves