in reply to Is the signal handler supposed to work like this?

As other have said, CTRL+Z is End-of-Data on Windows consoles, but then you must press <RETURN>, unlike UNIX.

(CTRL+D is only the default EOD on UNIX, it can be changed using stty(1), resulting in confusion and great fun for everyone).

Signal handling is not native to Windows, and does not sit well on that platform. Personally if I want to trap a console interrupt I use the Win32 API SetConsoleCtrlHandler.
  • Comment on Re: Is the signal handler supposed to work like this?