[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to make Ctrl-d not log off the shell?
From: |
mowgli |
Subject: |
Re: How to make Ctrl-d not log off the shell? |
Date: |
17 May 2007 12:53:26 -0700 |
User-agent: |
G2/1.0 |
On May 17, 1:48 pm, Dieter Wilhelm <die...@duenenhof-wilhelm.de>
wrote:
> Tyler Smith <tyler.sm...@mail.mcgill.ca> writes:
> > On 2007-05-16, mowgli <knowledgel...@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.
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