Enum PtyMode

java.lang.Object
java.lang.Enum<PtyMode>
org.apache.sshd.common.channel.PtyMode
All Implemented Interfaces:
Serializable, Comparable<PtyMode>

public enum PtyMode extends Enum<PtyMode>
A enum describing the tty modes according to RFC 4254 - section 8.
  • Enum Constant Details

    • VINTR

      public static final PtyMode VINTR
      Interrupt character; 255 if none. Similarly for the other characters. Not all of these characters are supported on all systems.
    • VQUIT

      public static final PtyMode VQUIT
      The quit character (sends SIGQUIT signal on POSIX systems).
    • VERASE

      public static final PtyMode VERASE
      Erase the character to left of the cursor.
    • VKILL

      public static final PtyMode VKILL
      Kill the current input line.
    • VEOF

      public static final PtyMode VEOF
      End-of-file character (sends EOF from the terminal).
    • VEOL

      public static final PtyMode VEOL
      End-of-line character in addition to carriage return and/or line-feed.
    • VEOL2

      public static final PtyMode VEOL2
      Additional end-of-line character.
    • VSTART

      public static final PtyMode VSTART
      Continues paused output (normally control-Q).
    • VSTOP

      public static final PtyMode VSTOP
      Pauses output (normally control-S).
    • VSUSP

      public static final PtyMode VSUSP
      Suspends the current program.
    • VDSUSP

      public static final PtyMode VDSUSP
      Another suspend character.
    • VREPRINT

      public static final PtyMode VREPRINT
      Reprints the current input line.
    • VWERASE

      public static final PtyMode VWERASE
      Erases a word left of cursor.
    • VLNEXT

      public static final PtyMode VLNEXT
      Enter the next character typed literally, even if it is a special character
    • VFLUSH

      public static final PtyMode VFLUSH
      Character to flush output.
    • VSWTCH

      public static final PtyMode VSWTCH
      Switch to a different shell layer.
    • VSTATUS

      public static final PtyMode VSTATUS
      Prints system status line (load, command, pid, etc).
    • VDISCARD

      public static final PtyMode VDISCARD
      Toggles the flushing of terminal output.
    • IGNPAR

      public static final PtyMode IGNPAR
      The ignore parity flag. The parameter SHOULD be 0 if this flag is FALSE, and 1 if it is TRUE.
    • PARMRK

      public static final PtyMode PARMRK
      Mark parity and framing errors.
    • INPCK

      public static final PtyMode INPCK
      Enable checking of parity errors.
    • ISTRIP

      public static final PtyMode ISTRIP
      Strip 8th bit off characters.
    • INLCR

      public static final PtyMode INLCR
      Map NL into CR on input.
    • IGNCR

      public static final PtyMode IGNCR
      Ignore CR on input.
    • ICRNL

      public static final PtyMode ICRNL
      Map CR to NL on input.
    • IUCLC

      public static final PtyMode IUCLC
      Translate uppercase characters to lowercase.
    • IXON

      public static final PtyMode IXON
      Enable output flow control.
    • IXANY

      public static final PtyMode IXANY
      Any char will restart after stop.
    • IXOFF

      public static final PtyMode IXOFF
      Enable input flow control.
    • IMAXBEL

      public static final PtyMode IMAXBEL
      Ring bell on input queue full.
    • IUTF8

      public static final PtyMode IUTF8
      See Also:
    • ISIG

      public static final PtyMode ISIG
      Enable signals INTR, QUIT, [D]SUSP.
    • ICANON

      public static final PtyMode ICANON
      Canonicalize input lines.
    • XCASE

      public static final PtyMode XCASE
      Enable input and output of uppercase characters by preceding their lowercase equivalents with "\".
    • ECHO

      public static final PtyMode ECHO
      Enable echoing.
    • ECHOE

      public static final PtyMode ECHOE
      Visually erase chars.
    • ECHOK

      public static final PtyMode ECHOK
      Kill character discards current line.
    • ECHONL

      public static final PtyMode ECHONL
      Echo NL even if ECHO is off.
    • NOFLSH

      public static final PtyMode NOFLSH
      Don't flush after interrupt.
    • TOSTOP

      public static final PtyMode TOSTOP
      Stop background jobs from output.
    • IEXTEN

      public static final PtyMode IEXTEN
      Enable extensions.
    • ECHOCTL

      public static final PtyMode ECHOCTL
      Echo control characters as ^(Char).
    • ECHOKE

      public static final PtyMode ECHOKE
      Visual erase for line kill.
    • PENDIN

      public static final PtyMode PENDIN
      Retype pending input.
    • OPOST

      public static final PtyMode OPOST
      Enable output processing.
    • OLCUC

      public static final PtyMode OLCUC
      Convert lowercase to uppercase.
    • ONLCR

      public static final PtyMode ONLCR
      Map NL to CR-NL.
    • OCRNL

      public static final PtyMode OCRNL
      Translate carriage return to newline (output).
    • ONOCR

      public static final PtyMode ONOCR
      Translate newline to carriage return-newline (output).
    • ONLRET

      public static final PtyMode ONLRET
      Newline performs a carriage return (output).
    • CS7

      public static final PtyMode CS7
      7 bit mode.
    • CS8

      public static final PtyMode CS8
      8 bit mode.
    • PARENB

      public static final PtyMode PARENB
      Parity enable.
    • PARODD

      public static final PtyMode PARODD
      Odd parity, else even.
    • TTY_OP_ISPEED

      public static final PtyMode TTY_OP_ISPEED
      Specifies the input baud rate in bits per second.
    • TTY_OP_OSPEED

      public static final PtyMode TTY_OP_OSPEED
      Specifies the output baud rate in bits per second.
  • Field Details

  • Constructor Details

    • PtyMode

      private PtyMode(int v)
  • Method Details

    • values

      public static PtyMode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static PtyMode valueOf(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:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • toInt

      public int toInt()
    • fromInt

      public static PtyMode fromInt(int b)
      Parameters:
      b - The numeric value of the option
      Returns:
      The matching PtyMode or null if no match found
      See Also:
    • fromName

      public static PtyMode fromName(String name)
    • createEnabledOptions

      public static Map<PtyMode,Integer> createEnabledOptions(PtyMode... options)
      Parameters:
      options - The options to enable - ignored if null/empty
      Returns:
      A Map where all the specified PtyModes have TRUE_SETTING
    • createEnabledOptions

      public static Map<PtyMode,Integer> createEnabledOptions(Collection<PtyMode> options)
      Parameters:
      options - The options to enable - ignored if null/empty
      Returns:
      A Map where all the specified PtyModes have TRUE_SETTING
    • resolveEnabledOptions

      public static Set<PtyMode> resolveEnabledOptions(Map<PtyMode,?> modes, PtyMode... options)
    • resolveEnabledOptions

      public static Set<PtyMode> resolveEnabledOptions(Map<PtyMode,?> modes, Collection<PtyMode> options)
      Parameters:
      modes - The PTY settings - ignored if null/empty
      options - The options that should be enabled
      Returns:
      A Set of all the PtyModes that appeared in the settings and were enabled
      See Also:
    • getBooleanSettingValue

      public static boolean getBooleanSettingValue(Map<PtyMode,?> modes, PtyMode m)
      Parameters:
      modes - The current modes Map-ing
      m - The required PtyMode
      Returns:
      true if all of these conditions hold:
      • Modes map is not null/empty
      • Required mode setting is not null
      • The setting has a mapped value
      • The mapped value is a Number
      • The Number.intValue() is non-zero
      See Also:
    • getBooleanSettingValue

      public static boolean getBooleanSettingValue(Map<PtyMode,?> modes, Collection<PtyMode> enablers, boolean defaultValue)
      Parameters:
      modes - The Map of PtyModes resolved by the "pty-req" message.
      enablers - A Collection of enabler settings to be consulted
      defaultValue - The default value to be used if no definite setting could be deduced
      Returns:
      true if the CR mode is enabled:
      • Ifmodes or enablers are null/empty then defaultValue is used
      • If any of the enablers modes are enabled then the CR mode is enabled.
      • If none of the enablers modes were specified then use defaultValue
      • Otherwise (i.e., at least one or more of the enablers modes were specified, but all of them said no) then false.
    • getBooleanSettingValue

      public static boolean getBooleanSettingValue(Object v)
      Parameters:
      v - The value to be tested
      Returns:
      true if all of these conditions hold:
      See Also:
    • getBooleanSettingValue

      public static boolean getBooleanSettingValue(int v)
      Parameters:
      v - The setting value
      Returns:
      true if value is non-zero
    • isCharSetting

      public static boolean isCharSetting(PtyMode m)
      Parameters:
      m - The PtyMode
      Returns:
      true if not null and one of the settings that refers to a character value - name usually starts with Vxxx