Enum Terminal.Signal

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Terminal.Signal>
    Enclosing interface:
    Terminal

    public static enum Terminal.Signal
    extends java.lang.Enum<Terminal.Signal>
    Types of signals that can be handled by terminal applications.

    Signals represent asynchronous notifications that can be sent to the application in response to certain events or user actions. Each signal type corresponds to a specific event or key combination:

    • INT - Interrupt signal (typically Ctrl+C)
    • QUIT - Quit signal (typically Ctrl+\)
    • TSTP - Terminal stop signal (typically Ctrl+Z)
    • CONT - Continue signal (sent when resuming after TSTP)
    • INFO - Information signal (typically Ctrl+T on BSD systems)
    • WINCH - Window change signal (sent when terminal size changes)

    Note that signal handling behavior may vary across different platforms and terminal implementations. Some signals may not be available or may behave differently on certain systems.

    See Also:
    Terminal.handle(Signal, SignalHandler), Terminal.raise(Signal)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      CONT
      Continue signal, sent when resuming a process after suspension.
      INFO
      Information signal, typically generated by pressing Ctrl+T on BSD systems.
      INT
      Interrupt signal, typically generated by pressing Ctrl+C.
      QUIT
      Quit signal, typically generated by pressing Ctrl+\.
      TSTP
      Terminal stop signal, typically generated by pressing Ctrl+Z.
      WINCH
      Window change signal, sent when the terminal window size changes.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Terminal.Signal valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static Terminal.Signal[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • INT

        public static final Terminal.Signal INT
        Interrupt signal, typically generated by pressing Ctrl+C. Used to interrupt or terminate a running process.
      • QUIT

        public static final Terminal.Signal QUIT
        Quit signal, typically generated by pressing Ctrl+\. Often used to force a core dump or immediate termination. Note: The JVM does not easily allow catching this signal natively.
      • TSTP

        public static final Terminal.Signal TSTP
        Terminal stop signal, typically generated by pressing Ctrl+Z. Used to suspend the current process.
      • CONT

        public static final Terminal.Signal CONT
        Continue signal, sent when resuming a process after suspension. This signal is sent to a process when it's resumed after being stopped by TSTP.
      • INFO

        public static final Terminal.Signal INFO
        Information signal, typically generated by pressing Ctrl+T on BSD systems. Used to request status information from a running process.
      • WINCH

        public static final Terminal.Signal WINCH
        Window change signal, sent when the terminal window size changes. Applications can handle this signal to adjust their display accordingly.
    • Method Detail

      • values

        public static Terminal.Signal[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Terminal.Signal c : Terminal.Signal.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Terminal.Signal valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null