From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30971 invoked by alias); 5 Mar 2006 06:06:27 -0000 Received: (qmail 30961 invoked by uid 22791); 5 Mar 2006 06:06:26 -0000 X-Spam-Check-By: sourceware.org Received: from mta04.pge.com (HELO mta04.pge.com) (131.89.129.74) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 05 Mar 2006 06:06:25 +0000 Received: from mta12.comp.pge.com (mta12.comp.pge.com [10.245.211.127]) by mta04.pge.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id k2566Nag024559 for ; Sat, 4 Mar 2006 22:06:23 -0800 (PST) Received: from mdssdev05.comp.pge.com (mdssdev05.comp.pge.com [10.244.96.61]) by mta12.comp.pge.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id k2566MYm029174; Sat, 4 Mar 2006 22:06:22 -0800 (PST) Received: (from esp5@localhost) by mdssdev05.comp.pge.com (8.11.7p1+Sun/8.11.7) id k2566L611722; Sat, 4 Mar 2006 22:06:21 -0800 (PST) Date: Sun, 05 Mar 2006 06:06:00 -0000 From: Ed Peschko To: gdb@sourceware.org Cc: esp5@pge.com Subject: tcsh-like intelligent history search keybindings Message-ID: <20060305060621.GA11629@mdssdev05> References: <1141141566.19916.ezmlm@sourceware.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1141141566.19916.ezmlm@sourceware.org> User-Agent: Mutt/1.4.2.1i Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-03/txt/msg00037.txt.bz2 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 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' to match all commands *beginning* with p, not commands *containing* p. And finally, why isn't this the default behavior of and 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. )