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 CS77 bit mode.CS88 bit mode.ECHOEnable echoing.ECHOCTLEcho control characters as ^(Char).ECHOEVisually erase chars.ECHOKKill character discards current line.ECHOKEVisual erase for line kill.ECHONLEcho NL even if ECHO is off.ICANONCanonicalize input lines.ICRNLMap CR to NL on input.IEXTENEnable extensions.IGNCRIgnore CR on input.IGNPARThe ignore parity flag.IMAXBELRing bell on input queue full.INLCRMap NL into CR on input.INPCKEnable checking of parity errors.ISIGEnable signals INTR, QUIT, [D]SUSP.ISTRIPStrip 8th bit off characters.IUCLCTranslate uppercase characters to lowercase.IUTF8IXANYAny char will restart after stop.IXOFFEnable input flow control.IXONEnable output flow control.NOFLSHDon't flush after interrupt.OCRNLTranslate carriage return to newline (output).OLCUCConvert lowercase to uppercase.ONLCRMap NL to CR-NL.ONLRETNewline performs a carriage return (output).ONOCRTranslate newline to carriage return-newline (output).OPOSTEnable output processing.PARENBParity enable.PARMRKMark parity and framing errors.PARODDOdd parity, else even.PENDINRetype pending input.TOSTOPStop background jobs from output.TTY_OP_ISPEEDSpecifies the input baud rate in bits per second.TTY_OP_OSPEEDSpecifies the output baud rate in bits per second.VDISCARDToggles the flushing of terminal output.VDSUSPAnother suspend character.VEOFEnd-of-file character (sends EOF from the terminal).VEOLEnd-of-line character in addition to carriage return and/or line-feed.VEOL2Additional end-of-line character.VERASEErase the character to left of the cursor.VFLUSHCharacter to flush output.VINTRInterrupt character; 255 if none.VKILLKill the current input line.VLNEXTEnter the next character typed literally, even if it is a special characterVQUITThe quit character (sends SIGQUIT signal on POSIX systems).VREPRINTReprints the current input line.VSTARTContinues paused output (normally control-Q).VSTATUSPrints system status line (load, command, pid, etc).VSTOPPauses output (normally control-S).VSUSPSuspends the current program.VSWTCHSwitch to a different shell layer.VWERASEErases a word left of cursor.XCASEEnable input and output of uppercase characters by preceding their lowercase equivalents with "\".
-
Field Summary
Fields Modifier and Type Field Description static Comparator<PtyMode>BY_OPCODEstatic NavigableMap<Integer,PtyMode>COMMANDSstatic IntegerFALSE_SETTINGstatic Set<PtyMode>MODESstatic ToIntFunction<PtyMode>OPCODE_EXTRACTORstatic IntegerTRUE_SETTINGstatic byteTTY_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 PtyModefromInt(int b)static PtyModefromName(String name)static booleangetBooleanSettingValue(int v)static booleangetBooleanSettingValue(Object v)static booleangetBooleanSettingValue(Map<PtyMode,?> modes, Collection<PtyMode> enablers, boolean defaultValue)static booleangetBooleanSettingValue(Map<PtyMode,?> modes, PtyMode m)static booleanisCharSetting(PtyMode m)static Set<PtyMode>resolveEnabledOptions(Map<PtyMode,?> modes, Collection<PtyMode> options)static Set<PtyMode>resolveEnabledOptions(Map<PtyMode,?> modes, PtyMode... options)inttoInt()static PtyModevalueOf(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
Mapwhere all the specifiedPtyModes haveTRUE_SETTING
-
createEnabledOptions
public static Map<PtyMode,Integer> createEnabledOptions(Collection<PtyMode> options)
- Parameters:
options- The options to enable - ignored ifnull/empty- Returns:
- A
Mapwhere all the specifiedPtyModes 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
Setof all thePtyModes 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:
trueif 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- TheMapofPtyModes resolved by the "pty-req" message.enablers- ACollectionof enabler settings to be consulteddefaultValue- The default value to be used if no definite setting could be deduced- Returns:
trueif 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:
trueif 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:
trueif value is non-zero
-
-