This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: close cygwin window - bash doesnt save history


----- Original Message -----
From: Dario Alcocer <alcocer@helixdigital.com>
Date: Wed, 10 Jul 2002 08:17:50 -0700
To: cygwin@cygwin.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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]