Package org.apache.sshd.common.channel
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.- Author:
- Apache MINA SSHD Project
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CS7
7 bit mode.CS8
8 bit mode.ECHO
Enable echoing.ECHOCTL
Echo control characters as ^(Char).ECHOE
Visually erase chars.ECHOK
Kill character discards current line.ECHOKE
Visual erase for line kill.ECHONL
Echo NL even if ECHO is off.ICANON
Canonicalize input lines.ICRNL
Map CR to NL on input.IEXTEN
Enable extensions.IGNCR
Ignore CR on input.IGNPAR
The ignore parity flag.IMAXBEL
Ring bell on input queue full.INLCR
Map NL into CR on input.INPCK
Enable checking of parity errors.ISIG
Enable signals INTR, QUIT, [D]SUSP.ISTRIP
Strip 8th bit off characters.IUCLC
Translate uppercase characters to lowercase.IUTF8
IXANY
Any char will restart after stop.IXOFF
Enable input flow control.IXON
Enable output flow control.NOFLSH
Don't flush after interrupt.OCRNL
Translate carriage return to newline (output).OLCUC
Convert lowercase to uppercase.ONLCR
Map NL to CR-NL.ONLRET
Newline performs a carriage return (output).ONOCR
Translate newline to carriage return-newline (output).OPOST
Enable output processing.PARENB
Parity enable.PARMRK
Mark parity and framing errors.PARODD
Odd parity, else even.PENDIN
Retype pending input.TOSTOP
Stop background jobs from output.TTY_OP_ISPEED
Specifies the input baud rate in bits per second.TTY_OP_OSPEED
Specifies the output baud rate in bits per second.VDISCARD
Toggles the flushing of terminal output.VDSUSP
Another suspend character.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.VERASE
Erase the character to left of the cursor.VFLUSH
Character to flush output.VINTR
Interrupt character; 255 if none.VKILL
Kill the current input line.VLNEXT
Enter the next character typed literally, even if it is a special characterVQUIT
The quit character (sends SIGQUIT signal on POSIX systems).VREPRINT
Reprints the current input line.VSTART
Continues paused output (normally control-Q).VSTATUS
Prints system status line (load, command, pid, etc).VSTOP
Pauses output (normally control-S).VSUSP
Suspends the current program.VSWTCH
Switch to a different shell layer.VWERASE
Erases a word left of cursor.XCASE
Enable input and output of uppercase characters by preceding their lowercase equivalents with "\".
-
Field Summary
Fields Modifier and Type Field Description static Comparator<PtyMode>
BY_OPCODE
static NavigableMap<Integer,PtyMode>
COMMANDS
static Integer
FALSE_SETTING
static Set<PtyMode>
MODES
static ToIntFunction<PtyMode>
OPCODE_EXTRACTOR
static Integer
TRUE_SETTING
static byte
TTY_OP_END
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Map<PtyMode,Integer>
createEnabledOptions(Collection<PtyMode> options)
static Map<PtyMode,Integer>
createEnabledOptions(PtyMode... options)
static PtyMode
fromInt(int b)
static PtyMode
fromName(String name)
static boolean
getBooleanSettingValue(int v)
static boolean
getBooleanSettingValue(Object v)
static boolean
getBooleanSettingValue(Map<PtyMode,?> modes, Collection<PtyMode> enablers, boolean defaultValue)
static boolean
getBooleanSettingValue(Map<PtyMode,?> modes, PtyMode m)
static boolean
isCharSetting(PtyMode m)
static Set<PtyMode>
resolveEnabledOptions(Map<PtyMode,?> modes, Collection<PtyMode> options)
static Set<PtyMode>
resolveEnabledOptions(Map<PtyMode,?> modes, PtyMode... options)
int
toInt()
static PtyMode
valueOf(String name)
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 Detail
-
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:
- IUTF8 Terminal Mode in Secure Shell
-
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 Detail
-
TTY_OP_END
public static final byte TTY_OP_END
- See Also:
- Constant Field Values
-
FALSE_SETTING
public static final Integer FALSE_SETTING
-
TRUE_SETTING
public static final Integer TRUE_SETTING
-
COMMANDS
public static final NavigableMap<Integer,PtyMode> COMMANDS
-
OPCODE_EXTRACTOR
public static final ToIntFunction<PtyMode> OPCODE_EXTRACTOR
-
BY_OPCODE
public static final Comparator<PtyMode> BY_OPCODE
- See Also:
OPCODE_EXTRACTOR
-
-
Method Detail
-
values
public static PtyMode[] 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 (PtyMode c : PtyMode.values()) System.out.println(c);
- 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 nameNullPointerException
- if the argument is null
-
toInt
public int toInt()
-
fromInt
public static PtyMode fromInt(int b)
-
createEnabledOptions
public static Map<PtyMode,Integer> createEnabledOptions(PtyMode... options)
- Parameters:
options
- The options to enable - ignored ifnull
/empty- Returns:
- A
Map
where all the specifiedPtyMode
s haveTRUE_SETTING
-
createEnabledOptions
public static Map<PtyMode,Integer> createEnabledOptions(Collection<PtyMode> options)
- Parameters:
options
- The options to enable - ignored ifnull
/empty- Returns:
- A
Map
where all the specifiedPtyMode
s haveTRUE_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 ifnull
/emptyoptions
- The options that should be enabled- Returns:
- A
Set
of all thePtyMode
s that appeared in the settings and were enabled - See Also:
getBooleanSettingValue(Map, PtyMode)
-
getBooleanSettingValue
public static boolean getBooleanSettingValue(Map<PtyMode,?> modes, PtyMode m)
- 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(Object)
-
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
public static boolean getBooleanSettingValue(Object v)
- 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(int)
-
getBooleanSettingValue
public static boolean getBooleanSettingValue(int v)
- Parameters:
v
- The setting value- Returns:
true
if value is non-zero
-
-