From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dieter Wilhelm Newsgroups: gmane.emacs.help Subject: Re: How to make Ctrl-d not log off the shell? Date: Thu, 17 May 2007 10:48:41 +0200 Organization: The Church of Emacs Message-ID: <87ejlf7s46.fsf@debby.local.net> References: <1179274192.552518.267470@h2g2000hsg.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1179391769 30824 80.91.229.12 (17 May 2007 08:49:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 17 May 2007 08:49:29 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Tyler Smith Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu May 17 10:49:28 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 1Hobfn-0004Hn-Nd for geh-help-gnu-emacs@m.gmane.org; Thu, 17 May 2007 10:49:23 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hobnr-0001WP-Rc for geh-help-gnu-emacs@m.gmane.org; Thu, 17 May 2007 04:57:43 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HobnX-0001WK-Tl for help-gnu-emacs@gnu.org; Thu, 17 May 2007 04:57:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HobnW-0001W8-FK for help-gnu-emacs@gnu.org; Thu, 17 May 2007 04:57:23 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HobnW-0001W5-9w for help-gnu-emacs@gnu.org; Thu, 17 May 2007 04:57:22 -0400 Original-Received: from moutng.kundenserver.de ([212.227.126.183]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HobfP-00008Q-8q for help-gnu-emacs@gnu.org; Thu, 17 May 2007 04:49:00 -0400 Original-Received: from [84.167.27.135] (helo=debby.local.net) by mrelayeu.kundenserver.de (node=mrelayeu7) with ESMTP (Nemesis), id 0ML2xA-1HobfH21aJ-0000v6; Thu, 17 May 2007 10:48:51 +0200 Original-Received: from dieter by debby.local.net with local (Exim 4.67) (envelope-from ) id 1Hobf7-0001cC-Nk; Thu, 17 May 2007 10:48:41 +0200 In-Reply-To: (Tyler Smith's message of "16 May 2007 03\:38\:52 GMT") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (gnu/linux) X-Provags-ID: V01U2FsdGVkX18+9QtWZxThLTaH+NDg0INFlWkmra2UEumecIR hznXRQYz/6MUTOJSIu52fChCsT08+4PZ8AFk7EsQQFl8H85VE0 ooJ0ItmzMCsli0NvKjKNN9bFS4Ea2il X-detected-kernel: Linux 2.6? (barebone, rare!) 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:44065 Archived-At: 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. -- Best wishes H. Dieter Wilhelm Darmstadt, Germany