| delorie.com/archives/browse.cgi | search | 
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm | 
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> | 
| List-Archive: | <http://sources.redhat.com/ml/cygwin/> | 
| List-Post: | <mailto:cygwin AT cygwin DOT com> | 
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> | 
| Sender: | cygwin-owner AT cygwin DOT com | 
| Mail-Followup-To: | cygwin AT cygwin DOT com | 
| Delivered-To: | mailing list cygwin AT cygwin DOT com | 
| Message-ID: | <20020711062601.15635.qmail@email.com> | 
| MIME-Version: | 1.0 | 
| From: | "Shane Brooks" <shane_brooks AT email DOT com> | 
| To: | cygwin AT cygwin DOT com | 
| Date: | Thu, 11 Jul 2002 01:26:01 -0500 | 
| Subject: | Re: close cygwin window - bash doesnt save history | 
| X-Originating-Ip: | 210.49.181.26 | 
| X-Originating-Server: | ws3-6.us4.outblaze.com | 
----- Original Message -----
From: Dario Alcocer <alcocer AT helixdigital DOT com>
Date: Wed, 10 Jul 2002 08:17:50 -0700
To: cygwin AT cygwin DOT com
Subject: Re: close cygwin window - bash doesnt save history
 
> Even better solution: register a signal handler in your Bash session
> for SIGHUP; the cygwin1.dll sends a hangup signal when CTRL_CLOSE_EVENT
> is received.  Something like this:
> 
>     $ myclosefn() {
>         echo "My close func got called." > $HOME/myclosefn.txt
>         # TODO: add more clean-up logic here
>     }
>     $ trap myclosefn SIGHUP
> 
> I've tested this, so I know it works.
 sounds great but perhaps I dont understand the answer - I'm not a programmer or unix boy.  I tried typing the following in a bash session but it didnt execute the exit statement when I closed the window.
$ myclosefn() {
> exit
> }
$ trap myclosefn SIGHUP
I guess Im hoping to find something I can put in my profile or bashrc that will behave as above to automagically perform the "exit" and save the history.
-- 
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
Save up to $160 by signing up for NetZero Platinum Internet service.
http://www.netzero.net/?refcd=N2P0602NEP8
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/
| webmaster | delorie software privacy | 
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |