public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Ed Peschko <esp5@pge.com>
To: gdb@sourceware.org
Cc: esp5@pge.com
Subject: tcsh-like intelligent history search keybindings
Date: Sun, 05 Mar 2006 06:06:00 -0000	[thread overview]
Message-ID: <20060305060621.GA11629@mdssdev05> (raw)
In-Reply-To: <1141141566.19916.ezmlm@sourceware.org>

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.
)

           reply	other threads:[~2006-03-05  6:06 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1141141566.19916.ezmlm@sourceware.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060305060621.GA11629@mdssdev05 \
    --to=esp5@pge.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).