Interface VtHandler


public interface VtHandler
Callback interface for VT escape sequence parser events.

All methods have default no-op implementations so that consumers only need to override the events they care about.

The parameter arrays passed to callbacks are reused between calls — consumers must copy the data if they need to retain it.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    csiDispatch(int finalChar, int[] params, int paramCount, int[] intermediates, int intermediateCount, boolean hasSubParams)
    A CSI (Control Sequence Introducer) sequence was completed.
    default void
    escDispatch(int finalChar, int[] intermediates, int intermediateCount)
    An escape sequence was completed.
    default void
    execute(int controlChar)
    A C0 or C1 control character was received.
    default void
    hook(int finalChar, int[] params, int paramCount, int[] intermediates, int intermediateCount)
    A DCS (Device Control String) was started.
    default void
    oscEnd(String data)
    An OSC (Operating System Command) string was completed.
    default void
    print(int codePoint)
    A printable character was received in the ground state.
    default void
    put(int b)
    A data byte within a DCS passthrough string.
    default void
    The DCS passthrough string has ended (ST, CAN, SUB, or ESC received).
  • Method Details

    • print

      default void print(int codePoint)
      A printable character was received in the ground state.
      Parameters:
      codePoint - the character (0x20-0x7F or 0xA0-0xFF)
    • execute

      default void execute(int controlChar)
      A C0 or C1 control character was received.
      Parameters:
      controlChar - the control character (0x00-0x1F, 0x80-0x9F)
    • escDispatch

      default void escDispatch(int finalChar, int[] intermediates, int intermediateCount)
      An escape sequence was completed.

      Examples: ESC M (Reverse Index), ESC ( B (Select charset).

      Parameters:
      finalChar - the final character of the sequence
      intermediates - the intermediate characters (0x20-0x2F)
      intermediateCount - the number of intermediate characters
    • csiDispatch

      default void csiDispatch(int finalChar, int[] params, int paramCount, int[] intermediates, int intermediateCount, boolean hasSubParams)
      A CSI (Control Sequence Introducer) sequence was completed.

      Examples: CSI 2 J (Erase Display), CSI ? 1049 h (Alt Screen).

      The first intermediate may be a private marker (0x3C-0x3F: < = > ?). Parameter value -1 indicates a default (empty) parameter.

      Parameters:
      finalChar - the final character (0x40-0x7E)
      params - the parameter values (-1 = default)
      paramCount - the number of parameters
      intermediates - the intermediate/private-marker characters
      intermediateCount - the number of intermediates
      hasSubParams - true if colon-separated subparameters were present
    • hook

      default void hook(int finalChar, int[] params, int paramCount, int[] intermediates, int intermediateCount)
      A DCS (Device Control String) was started.

      The first part of the DCS has been parsed (parameters, intermediates, final character). Subsequent data arrives via put(int) until unhook() is called.

      Parameters:
      finalChar - the final character determining the control function
      params - the parameter values
      paramCount - the number of parameters
      intermediates - the intermediate characters
      intermediateCount - the number of intermediates
    • put

      default void put(int b)
      A data byte within a DCS passthrough string.
      Parameters:
      b - the data byte
    • unhook

      default void unhook()
      The DCS passthrough string has ended (ST, CAN, SUB, or ESC received).
    • oscEnd

      default void oscEnd(String data)
      An OSC (Operating System Command) string was completed.

      Examples: OSC 0 ; title BEL (Set Title), OSC 10 ; ? BEL (Query Foreground Color).

      Parameters:
      data - the OSC string content (between the OSC introducer and terminator)