unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Dieter Wilhelm <dieter@duenenhof-wilhelm.de>
To: Tyler Smith <tyler.smith@mail.mcgill.ca>
Cc: help-gnu-emacs@gnu.org
Subject: Re: How to make Ctrl-d not log off the shell?
Date: Thu, 17 May 2007 10:48:41 +0200	[thread overview]
Message-ID: <87ejlf7s46.fsf@debby.local.net> (raw)
In-Reply-To: <slrnf4l2ms.99i.tyler.smith@blackbart.mynetwork> (Tyler Smith's message of "16 May 2007 03\:38\:52 GMT")

Tyler Smith <tyler.smith@mail.mcgill.ca> writes:

> On 2007-05-16, mowgli <knowledgeless@gmail.com> 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

  reply	other threads:[~2007-05-17  8:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-16  0:09 How to make Ctrl-d not log off the shell? mowgli
2007-05-16  3:38 ` Tyler Smith
2007-05-17  8:48   ` Dieter Wilhelm [this message]
     [not found]   ` <mailman.761.1179392245.32220.help-gnu-emacs@gnu.org>
2007-05-17 19:53     ` mowgli
2007-05-18  7:17       ` Dieter Wilhelm
2007-05-22  4:37         ` Xavier Maillard
2007-06-09 22:37   ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2007-05-16  6:48 martin rudalics

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87ejlf7s46.fsf@debby.local.net \
    --to=dieter@duenenhof-wilhelm.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=tyler.smith@mail.mcgill.ca \
    /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).