There should be a way to handle operating system signals, especially UNIX's SIGINT.
Consider a command interpreter written in Java and running on any support Java
platform. Essentially all operating systems provide a way to interrupt the
currently running program. A Java command interpreter needs the ability to
catch this interrupt request and abort operations in progress, and then return
to the main command-reading loop. Thus, handling this signal and aborting
operations must not require closing the input device.
Such a mechanism should also support handling POSIX-specific and other operating
system-specific signals as much as possible. SIGTSTP and SIGCONT would be
especially important for a command interpreter.
Obviously any solution that effectively requires putting the terminal device into
raw mode and emulating terminal-generated signals would be completely unacceptable.
Any solution must integrate with the operating system's signal handling capabilities.
Consider a command interpreter written in Java and running on any support Java
platform. Essentially all operating systems provide a way to interrupt the
currently running program. A Java command interpreter needs the ability to
catch this interrupt request and abort operations in progress, and then return
to the main command-reading loop. Thus, handling this signal and aborting
operations must not require closing the input device.
Such a mechanism should also support handling POSIX-specific and other operating
system-specific signals as much as possible. SIGTSTP and SIGCONT would be
especially important for a command interpreter.
Obviously any solution that effectively requires putting the terminal device into
raw mode and emulating terminal-generated signals would be completely unacceptable.
Any solution must integrate with the operating system's signal handling capabilities.
- relates to
-
JDK-8087286 Need a way to handle control-C and possibly some other signals
- Open