From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: mowgli Newsgroups: gmane.emacs.help Subject: Re: How to make Ctrl-d not log off the shell? Date: 17 May 2007 12:53:26 -0700 Organization: http://groups.google.com Message-ID: <1179431606.520241.256110@h2g2000hsg.googlegroups.com> References: <1179274192.552518.267470@h2g2000hsg.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1179433967 21389 80.91.229.12 (17 May 2007 20:32:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 17 May 2007 20:32:47 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu May 17 22:32:46 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HomeT-0003nc-Qb for geh-help-gnu-emacs@m.gmane.org; Thu, 17 May 2007 22:32:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hommb-0004yU-KA for geh-help-gnu-emacs@m.gmane.org; Thu, 17 May 2007 16:41:09 -0400 Original-Path: shelby.stanford.edu!newshub.stanford.edu!postnews.google.com!h2g2000hsg.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-NNTP-Posting-Host: 221.128.144.253 Original-X-Trace: posting.google.com 1179431616 1820 127.0.0.1 (17 May 2007 19:53:36 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 17 May 2007 19:53:36 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.3) Gecko/20070310 Iceweasel/2.0.0.3 (Debian-2.0.0.3-1),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: h2g2000hsg.googlegroups.com; posting-host=221.128.144.253; posting-account=-HXNwg0AAADDAYolbLkw7x9oaDWGNwXB Original-Xref: shelby.stanford.edu gnu.emacs.help:148509 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:44101 Archived-At: On May 17, 1:48 pm, Dieter Wilhelm wrote: > Tyler Smith writes: > > On 2007-05-16, mowgli wrote: > >> How do you make pressing Ctrl-d not log off the shell and instead ask > >> a question like Do you really want to quit? typing y quits the shell. > > > (add-hook 'comint-mode-hook > > '(lambda () > > (define-key comint-mode-map "\C-d" 'delete-char))) > > This might be an alternative at least when using a bash shell or > similar: > > I mitigated such a problem for terminals and for the *shell* buffer > with placing the following in my .bashrc: > > export IGNOREEOF=1 # only ^D twice is exiting now > > Since it prints a warning before typing the decisive (in this case > second) C-d. This is what I wanted. But instead of twice, it would be nice to have 5 times instead. Because whenever there's an accidental logoff it's mostly due to many Ctrl-d presses and not just two. Where can I find documentaion for C-d for bash? Regards, mowgli