Enum Terminal.Mode

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

    public static enum Terminal.Mode
    extends java.lang.Enum<Terminal.Mode>
    Terminal modes that JLine probes for support.

    Most modes are DEC private modes probed via DECRQM (CSI ? Pd $ p / CSI ? Pd ; Ps $ y). Non-DEC modes such as the Kitty Keyboard Protocol and Sixel graphics use their own detection mechanism but are probed in the same batch and cached identically.

    Support is detected at most once per terminal and the results are cached for subsequent queries.

    See Also:
    Terminal.isModeSupported(Mode)
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int mode()
      Returns the DEC private mode number, 0 for modes that use a custom query (e.g.
      static Terminal.Mode valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static Terminal.Mode[] 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

      • SIXEL

        public static final Terminal.Mode SIXEL
        Sixel graphics support.

        Detected from the DA1 (Primary Device Attributes) response (CSI c / CSI ? ... c): attribute code 4 indicates Sixel support. No extra query is needed ? the DA1 response is already read as the batch probe sentinel.

      • SYNCHRONIZED_OUTPUT

        public static final Terminal.Mode SYNCHRONIZED_OUTPUT
        Synchronized output (DEC private mode 2026).
      • GRAPHEME_CLUSTER

        public static final Terminal.Mode GRAPHEME_CLUSTER
        Grapheme cluster / Unicode Core (DEC private mode 2027).
      • IN_BAND_RESIZE

        public static final Terminal.Mode IN_BAND_RESIZE
        In-band window resize notifications (DEC private mode 2048).
    • Method Detail

      • values

        public static Terminal.Mode[] 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.Mode c : Terminal.Mode.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.Mode 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
      • mode

        public int mode()
        Returns the DEC private mode number, 0 for modes that use a custom query (e.g. KITTY_KEYBOARD), or a negative value for modes detected from the DA1 response (e.g. SIXEL).