[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to make Ctrl-d not log off the shell?
From: |
Dieter Wilhelm |
Subject: |
Re: How to make Ctrl-d not log off the shell? |
Date: |
Thu, 17 May 2007 10:48:41 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (gnu/linux) |
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