Click to See Complete Forum and Search --> : how can i trap the terminal signal in C++ program


mr_ss
06-12-2001, 06:01 AM
i want to catch or lock the terminal signals like closing terminal from the close box or from treminal menu option in my C++ program running in the same terminal.
bundle of thanks in advance for my helpers.

Strike
06-12-2001, 12:15 PM
Well, unless you created the window, you can't really control events that happen when the user closes a window. You can do this, of course, but you'll have to learn how to program in some X toolkit. If you want to trap the SIGTERM signal, then check out the man pages for signal and sigaction. The SIGTERM signal is what is sent to a program when you try to kill it or when you hit CTRL-c