Hi Bob,
On Fri, Sep 26, 2008 at 10:08 AM, Bob Rossi <bob...@co...> wrote:
> On Fri, Sep 26, 2008 at 03:21:59AM -0400, Kuang He wrote:
>> I'm using cgdb 0.6.4 on a linux box (Ubuntu 8.04), with libreadline
>> v5.2. The default readline hotkeys Alt-X (e.g. Alt-P/N for
>> history-search-backward/history-search-forward, Alt-F/B for moving a
>> word forward/backward) do not work in cgdb on my machine. Any Alt-X
>> combination key in the gdb window will result in switching to the
>> source code window, just as an ESC would do. I've tried to read cgdb's
>> source code to figure out why, but the code is more complex than I've
>> thought. Any enlightenment would be welcome.
>
> OK, here is the real issue. This comes directly from the vim manual,
>
> By default Vim assumes that pressing the ALT key sets the 8th bit of a typed
> character. Most decent terminals can work that way, such as xterm, aterm and
> rxvt. If your <A-k> mappings don't work it might be that the terminal is
> prefixing the character with an ESC character. But you can just as well type
> ESC before a character, thus Vim doesn't know what happened (except for
> checking the delay between characters, which is not reliable).
>
> Please type ':help alt-keys' to read more about this.
Thanks for the explanation!
> Does typing Alt-P work for you in bash? I'm assuming that the terminal
> is sending Esc-p for you in this case.
Yes, Alt-P/N/F/B work fine for me in bash, and other applications on
my system that use readline. I guess the terminal is sending ESC-
sequences when I press Alt+ other keys, since in vim, when I press
Alt+i, it is equivalent to ESC followed by an i key, etc.
> The problem is that some terminals set the 8th bit of the ascii char, to
> tell you that alt was being pushed and some termainls send esc-char. To
> seperate characters. cgdb initially supported reading esc-char as an
> alt charachter. However, I found as I started to type esc-o to get into
> the file dialog, I would type it to fast, and cgdb would recognize it as
> alt-o. This frustrated me, I learned more, and then disabled the
> alt processing. I believe vim has also disabled this processing.
>
> I'm considering resurrecting this functionality, and making it optional.
I have the following in my ~/.inputrc:
set input-meta on
set output-meta on
set convert-meta off
I tried to toggle their values from on->off or off->on in different
combinations, but it did not help.
>> Also, I personally like to define PageUp/PageDown in my ~/.inputrc to
>> do the same thing as Alt-P/N, but since PageUp/PageDown have been used
>> by cgdb to scroll the screen, I could not use these hotkeys as I like
>> to. I've changed the code to fix that (for myself), but I guess there
>> is no generic solution since all the hotkeys cgdb use are hard coded
>> into the source.
>
> The version of cgdb in svn trunk/, which I really want to release soon,
> has the ability to map keys.
I see from the mailing list archive that you've been meaning to
release this for some time. Looking forward to it!
By the way, when I press CTRL-L in the gdb window, it does not clear
the screen, but rather generates a new input line. Is this intended,
or a bug?
Best regards,
Kuang He
|