On Fri, Sep 26, 2008 at 03:21:59AM -0400, Kuang He wrote:
> Hi all,
>
> I'm a new user of cgdb and find it very useful. The vi key binding is
> very nice, too, since I'm a vim user. Thank you, cgdb developers!
I'm glad you enjoy it.
> 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.
Does typing Alt-P work for you in bash? I'm assuming that the terminal
is sending Esc-p for you in this case.
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.
> 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. So, you could make a map like,
imap <PageUp> <A-p>
however, because of the alt issue, this binding doesn't work yet. You
can test out the bindings by trying something like,
imap <PageUp> <S-p>
and you should notice that if you hit PageUp in gdb mode, that P is
produced.
Let me look into this more, and see what I can come up with.
Thanks,
Bob Rossi
|