Re: [Cgdb-users] key bindings
Brought to you by:
bobbybrasko,
crouchingturbo
From: William P. <bil...@gm...> - 2007-08-07 04:23:44
|
Bob Rossi wrote: > On Sun, Aug 05, 2007 at 08:19:13AM +0100, William Pursell wrote: >> >> I just started using cgdb a few weeks ago, and I'm loving it. This >> is a great tool. Thanks! >> >> I'm having a problem that seems related to the discussion in the >> archive around Aug '04 with the thread subject "key bindings". > > Hi William, > > There currently isn't a workaround that I know of. However, I would love > to see this issue fixed. I don't use readline in vi mode, so I have > never run into this problem. > > For starters, how do you put readline in vi mode when using cgdb? Do you > have to put something in your .inputrc? If so, what do you put in there? set editing-mode vi I actually set that as the first line in /etc/inputrc on all boxes on which I have root. Well, not quite all, but any box that I "own"...my co-workers hate me for it, but I think it's good for them as they might otherwise never even realize that readline has options. > >> When in GDB mode and with readline in vi-mode, I can do: >> '<esc>kkAfoo' to append the text 'foo' to the command >> executed 2 instances back in the history, but I can't > > OK, I'm confused as to why this works for you, I would like to reproduce > it. After you type '<esc>kkAfoo', you are still in GDB mode? I would > except that you would be put into the source window. Yes, still in gdb mode. I can edit the line as long as I don't go into insert mode. (ie, I can delete characters with 'x' and replace single characters with 'r', but if I use 'i', 'a', or 'R', I can't get back to command mode in readline) > >> edit the line beyond that. Ie, if I try to replace >> 'foo' with 'bar', I would normally do: '<esc>FfRbar', >> but the esc there is being grabbed by cgdb and sending >> me into the source window. > > Yes, this currently makes sense to me. > >> Is there a workaround for this? > > Not that I know of. However, I think if we can come up with a solution > to this problem, it shouldn't be to hard to add to CGDB. Is the issue > that sometimes when you hit <Esc> you want to stay in GDB mode and > sometimes you want to go to CGDB mode? How would CGDB know the > difference? > > One solution, which wouldn't be super friendly, is to provide a way to > send esc to readline by having an escape key. For instance, if you type > '<esc><esc>', than that escape goes to gdb. These solutions tend to be > a pain on users I think though. I agree that it would be a pain. Personally, I would prefer that esc always go to readline, and some other key be used to switch to the cgdb window, but I can't see that being an acceptable solution at all. Perhaps that could simply be made an option with an alternate key-binding as a value. I haven't yet had a chance to read through very much of the cgdb documentation yet, so I'm not going to have much insight into what would be appropriate. |