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


From: Randall R Schulz <rrschulz@cris.com>
> (*) In further investigating options using "trap," I discovered I can no 
> longer repeat my earlier success, regardless of whether I use "tty" or not.

I used "history -a" , but it appears the trap is being called when the window closes as I can call "myclosefn" OK.  I have been typing this at the BASH command prompt, not editing a .bash_login or profile. So my session looks like..

Shane@GUINNESS ~
$ myclose () {
> history -a
> }

Shane@GUINNESS ~
$ trap myclosefn SIGHUP

Shane@GUINNESS ~
$

using shopt I see that the builtin command huponexit is OFF, but that should be OK shouldnt it?  the man page suggests huponexit allows tasks that are not in the job table to recieve the SIGHUP also.

from the man page "When Bash receives a signal for which a trap has been set while waiting for a command to complete, the trap will not be executed until the command completes." - perhaps under windows its too late once the command has completed?  ie the window is already closed?

Interestingly I see something flash onto the command line just before the window closes..but my machine is too fast to allow me to read it.


-- 
__________________________________________________________
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]