This is the mail archive of the 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 <>
> (*) 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..

$ myclose () {
> history -a
> }

$ trap myclosefn SIGHUP


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

Save up to $160 by signing up for NetZero Platinum Internet service.

Unsubscribe info:
Bug reporting:

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