Package org.apache.sshd.common.channel
Enum PtyMode
- All Implemented Interfaces:
Serializable
,Comparable<PtyMode>
A enum describing the tty modes according to RFC 4254 -
section 8.
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescription7 bit mode.8 bit mode.Enable echoing.Echo control characters as ^(Char).Visually erase chars.Kill character discards current line.Visual erase for line kill.Echo NL even if ECHO is off.Canonicalize input lines.Map CR to NL on input.Enable extensions.Ignore CR on input.The ignore parity flag.Ring bell on input queue full.Map NL into CR on input.Enable checking of parity errors.Enable signals INTR, QUIT, [D]SUSP.Strip 8th bit off characters.Translate uppercase characters to lowercase.Any char will restart after stop.Enable input flow control.Enable output flow control.Don't flush after interrupt.Translate carriage return to newline (output).Convert lowercase to uppercase.Map NL to CR-NL.Newline performs a carriage return (output).Translate newline to carriage return-newline (output).Enable output processing.Parity enable.Mark parity and framing errors.Odd parity, else even.Retype pending input.Stop background jobs from output.Specifies the input baud rate in bits per second.Specifies the output baud rate in bits per second.Toggles the flushing of terminal output.Another suspend character.End-of-file character (sends EOF from the terminal).End-of-line character in addition to carriage return and/or line-feed.Additional end-of-line character.Erase the character to left of the cursor.Character to flush output.Interrupt character; 255 if none.Kill the current input line.Enter the next character typed literally, even if it is a special characterThe quit character (sends SIGQUIT signal on POSIX systems).Reprints the current input line.Continues paused output (normally control-Q).Prints system status line (load, command, pid, etc).Pauses output (normally control-S).Suspends the current program.Switch to a different shell layer.Erases a word left of cursor.Enable input and output of uppercase characters by preceding their lowercase equivalents with "\". -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Comparator
<PtyMode> static final NavigableMap
<Integer, PtyMode> static final Integer
static final ToIntFunction
<PtyMode> static final Integer
static final byte
private final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateEnabledOptions
(Collection<PtyMode> options) createEnabledOptions
(PtyMode... options) static PtyMode
fromInt
(int b) static PtyMode
static boolean
getBooleanSettingValue
(int v) static boolean
static boolean
getBooleanSettingValue
(Map<PtyMode, ?> modes, Collection<PtyMode> enablers, boolean defaultValue) static boolean
getBooleanSettingValue
(Map<PtyMode, ?> modes, PtyMode m) static boolean
resolveEnabledOptions
(Map<PtyMode, ?> modes, Collection<PtyMode> options) resolveEnabledOptions
(Map<PtyMode, ?> modes, PtyMode... options) int
toInt()
static PtyMode
Returns the enum constant of this type with the specified name.static PtyMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
VINTR
Interrupt character; 255 if none. Similarly for the other characters. Not all of these characters are supported on all systems. -
VQUIT
The quit character (sends SIGQUIT signal on POSIX systems). -
VERASE
Erase the character to left of the cursor. -
VKILL
Kill the current input line. -
VEOF
End-of-file character (sends EOF from the terminal). -
VEOL
End-of-line character in addition to carriage return and/or line-feed. -
VEOL2
Additional end-of-line character. -
VSTART
Continues paused output (normally control-Q). -
VSTOP
Pauses output (normally control-S). -
VSUSP
Suspends the current program. -
VDSUSP
Another suspend character. -
VREPRINT
Reprints the current input line. -
VWERASE
Erases a word left of cursor. -
VLNEXT
Enter the next character typed literally, even if it is a special character -
VFLUSH
Character to flush output. -
VSWTCH
Switch to a different shell layer. -
VSTATUS
Prints system status line (load, command, pid, etc). -
VDISCARD
Toggles the flushing of terminal output. -
IGNPAR
The ignore parity flag. The parameter SHOULD be 0 if this flag is FALSE, and 1 if it is TRUE. -
PARMRK
Mark parity and framing errors. -
INPCK
Enable checking of parity errors. -
ISTRIP
Strip 8th bit off characters. -
INLCR
Map NL into CR on input. -
IGNCR
Ignore CR on input. -
ICRNL
Map CR to NL on input. -
IUCLC
Translate uppercase characters to lowercase. -
IXON
Enable output flow control. -
IXANY
Any char will restart after stop. -
IXOFF
Enable input flow control. -
IMAXBEL
Ring bell on input queue full. -
IUTF8
- See Also:
-
ISIG
Enable signals INTR, QUIT, [D]SUSP. -
ICANON
Canonicalize input lines. -
XCASE
Enable input and output of uppercase characters by preceding their lowercase equivalents with "\". -
ECHO
Enable echoing. -
ECHOE
Visually erase chars. -
ECHOK
Kill character discards current line. -
ECHONL
Echo NL even if ECHO is off. -
NOFLSH
Don't flush after interrupt. -
TOSTOP
Stop background jobs from output. -
IEXTEN
Enable extensions. -
ECHOCTL
Echo control characters as ^(Char). -
ECHOKE
Visual erase for line kill. -
PENDIN
Retype pending input. -
OPOST
Enable output processing. -
OLCUC
Convert lowercase to uppercase. -
ONLCR
Map NL to CR-NL. -
OCRNL
Translate carriage return to newline (output). -
ONOCR
Translate newline to carriage return-newline (output). -
ONLRET
Newline performs a carriage return (output). -
CS7
7 bit mode. -
CS8
8 bit mode. -
PARENB
Parity enable. -
PARODD
Odd parity, else even. -
TTY_OP_ISPEED
Specifies the input baud rate in bits per second. -
TTY_OP_OSPEED
Specifies the output baud rate in bits per second.
-
-
Field Details
-
TTY_OP_END
public static final byte TTY_OP_END- See Also:
-
FALSE_SETTING
-
TRUE_SETTING
-
MODES
-
COMMANDS
-
OPCODE_EXTRACTOR
-
BY_OPCODE
- See Also:
-
v
private final int v
-
-
Constructor Details
-
PtyMode
private PtyMode(int v)
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
toInt
public int toInt() -
fromInt
- Parameters:
b
- The numeric value of the option- Returns:
- The matching
PtyMode
ornull
if no match found - See Also:
-
fromName
-
createEnabledOptions
- Parameters:
options
- The options to enable - ignored ifnull
/empty- Returns:
- A
Map
where all the specifiedPtyMode
s haveTRUE_SETTING
-
createEnabledOptions
- Parameters:
options
- The options to enable - ignored ifnull
/empty- Returns:
- A
Map
where all the specifiedPtyMode
s haveTRUE_SETTING
-
resolveEnabledOptions
-
resolveEnabledOptions
-
getBooleanSettingValue
- Parameters:
modes
- The current modesMap
-ingm
- The requiredPtyMode
- 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
- Modes map is not
- See Also:
-
getBooleanSettingValue
public static boolean getBooleanSettingValue(Map<PtyMode, ?> modes, Collection<PtyMode> enablers, boolean defaultValue) - Parameters:
modes
- TheMap
ofPtyMode
s resolved by the "pty-req" message.enablers
- ACollection
of enabler settings to be consulteddefaultValue
- 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
) thenfalse
.
- Ifmodes or enablers are
-
getBooleanSettingValue
- Parameters:
v
- The value to be tested- Returns:
true
if all of these conditions hold:- The mapped value is a
Number
- The
Number.intValue()
is non-zero
- The mapped value is a
- See Also:
-
getBooleanSettingValue
public static boolean getBooleanSettingValue(int v) - Parameters:
v
- The setting value- Returns:
true
if value is non-zero
-
isCharSetting
- Parameters:
m
- ThePtyMode
- Returns:
true
if notnull
and one of the settings that refers to a character value - name usually starts withVxxx
-