public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* tcsh-like intelligent history search keybindings
       [not found] <1141141566.19916.ezmlm@sourceware.org>
@ 2006-03-05  6:06 ` Ed Peschko
  0 siblings, 0 replies; only message in thread
From: Ed Peschko @ 2006-03-05  6:06 UTC (permalink / raw)
  To: gdb; +Cc: esp5

hey all,

I thought this would be a no-brainer, but apparently not.

I'd like gdb to behave like tcsh - I have the settings:

    bindkey -k up history-search-backward
    bindkey -k down history-search-forward

set in my .tcshrc. This makes it so that when I type:

	p<up arrow>

the command scrolls through my history, looking for commands that start with 
the letter 'p'. 'pe' == commands that begin with pe, etc.

I was assuming I could do the same thing with gdb with the ~/.inputrc file, ie:
putting the following entries in:

    "\M-OA": reverse-search-history
    "\M-OB": forward-search-history
 
    "\M-\C-OA": reverse-search-history
    "\M-\C-OB": forward-search-history

    "\M-\C-[A": reverse-search-history
    "\M-\C-[B": forward-search-history

But apparently not. So I had the following questions:

    1) what is the shortcut for the up and down arrow? ie:
       TAB: points to the tab key, RET: to return, etc. Not having a shortcut
       to the arrow keys seems a strange omission.

    2) is the above the right syntax to override the current default values
       for up arrow (which is to scroll through the history, one at a time 
       not caring whether or not the first characters match or not.

    3) is there a way to anchor 'reverse-search-history' to the beginning of 
       the search string. Ie: I want 'p<up>' to match all commands *beginning*
       with p, not commands *containing* p.

       
And finally, why isn't this the default behavior of <up> and <down> IMO its a 
lot more useful than the current behavior, which makes people hit the up arrow
scores of times to get back to an ever expanding history...

Ed

(ps - is there a way to make histories dependent on the name of the executable
being debugged, and a way to do this transparently?

ie: if I'm debugging executable_a, I want the arrow going up and down only to 
deal with executable_a history items, and executable_b to deal with executable_b
history items.

Again, this would be really helpful, IMO - if for example there was a switch
to turn this behaviour on and off when gdb is first executed, something 
like:

set executable-history on

or somesuch.
)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-03-05  6:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1141141566.19916.ezmlm@sourceware.org>
2006-03-05  6:06 ` tcsh-like intelligent history search keybindings Ed Peschko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).