Package com.sshtools.client
Class PseudoTerminalModes
java.lang.Object
com.sshtools.client.PseudoTerminalModes
When a client requests a pseudo terminal it informs the server of any terminal modes that it knows of. This is typically used in situations where advance terminal configuration is required but it can also be used to perform simple configuration such as turning off character echo.
NOTE: the server may ignore some of the modes set if it does not support them.
var session = ssh.openSessionChannel(); session.requestPseudoTerminal("vt100", 80, 24, 0, 0, PseudoTerminalModesBuilder.create(). // Turning off echo withMode(PseudoTerminalModes.ECHO, false). // Setting the Input/Output baud rate withMode(PseudoTerminalModes.TTY_OP_ISPEED, 38400). withMode(PseudoTerminalModes.TTY_OP_OSPEED, 38400). build());
- Author:
- Lee David Painter
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
7 bit mode.static final int
8 bit mode.static final int
Enable echoing.static final int
Echo control characters as ^(Char).static final int
Visually erase chars.static final int
Kill character discards current line.static final int
Visual erase for line kill.static final int
Echo NL even if ECHO is off.static final int
Canonicalize input lines.static final int
Map CR to NL on input.static final int
Enable extensions.static final int
Ignore CR on input.static final int
The ignore parity flag.static final int
Ring bell on input queue full.static final int
Map NL into CR on input.static final int
Enable checking of parity errors.static final int
Enable signals INTR, QUIT, [D]SUSP.static final int
Strip 8th bit off characters.static final int
Translate uppercase characters to lowercase.static final int
Output is assumed to be UTF-8static final int
Any char will restart after stop.static final int
Enable input flow control.static final int
Enable output flow control.static final int
Don't flush after interrupt.static final int
Translate carriage return to newline (output).static final int
Convert lowercase to uppercase.static final int
Map NL to CR-NL.static final int
Newline performs a carriage return (output).static final int
Translate newline to carriage return-newline (output).static final int
Enable output processing.static final int
Parity enable.static final int
Mark parity and framing errors.static final int
Odd parity, else even.static final int
Retype pending input.static final int
Stop background jobs from output.static final int
Specifies the input baud rate in bits per second.static final int
Specifies the output baud rate in bits per second.static final int
Toggles the flushing of terminal output.static final int
Another suspend character.static final int
End-of-file character (sends EOF from the terminal).static final int
End-of-line character in addition to carriage return and/or linefeed.static final int
Additional end-of-line character.static final int
Erase the character to left of the cursor.static final int
Character to flush output.static final int
Interrupt character; 255 if none.static final int
Kill the current input line.static final int
Enter the next character typed literally, even if it is a special characterstatic final int
The quit character (sends SIGQUIT signal on POSIX systems).static final int
Reprints the current input line.static final int
Continues paused output (normally control-Q).static final int
Prints system status line (load, command, pid, etc).static final int
Pauses output (normally control-S).static final int
Suspends the current program.static final int
Switch to a different shell layer.static final int
Erases a word left of cursor.static final int
Enable input and output of uppercase characters by preceding their lowercase equivalents with "\". -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version.PseudoTerminalModes
(byte[] modes) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionvoid
reset()
Deprecated, for removal: This API element is subject to removal in a future version.void
setTerminalMode
(int mode, boolean value) Deprecated, for removal: This API element is subject to removal in a future version.void
setTerminalMode
(int mode, int value) Deprecated, for removal: This API element is subject to removal in a future version.byte[]
Returns the encoded modes for use by theSshSession
.
-
Field Details
-
VINTR
public static final int VINTRInterrupt character; 255 if none.- See Also:
-
VQUIT
public static final int VQUITThe quit character (sends SIGQUIT signal on POSIX systems).- See Also:
-
VERASE
public static final int VERASEErase the character to left of the cursor.- See Also:
-
VKILL
public static final int VKILLKill the current input line.- See Also:
-
VEOF
public static final int VEOFEnd-of-file character (sends EOF from the terminal).- See Also:
-
VEOL
public static final int VEOLEnd-of-line character in addition to carriage return and/or linefeed.- See Also:
-
VEOL2
public static final int VEOL2Additional end-of-line character.- See Also:
-
VSTART
public static final int VSTARTContinues paused output (normally control-Q).- See Also:
-
VSTOP
public static final int VSTOPPauses output (normally control-S).- See Also:
-
VSUSP
public static final int VSUSPSuspends the current program.- See Also:
-
VDSUSP
public static final int VDSUSPAnother suspend character.- See Also:
-
VREPRINT
public static final int VREPRINTReprints the current input line.- See Also:
-
VWERASE
public static final int VWERASEErases a word left of cursor.- See Also:
-
VLNEXT
public static final int VLNEXTEnter the next character typed literally, even if it is a special character- See Also:
-
VFLUSH
public static final int VFLUSHCharacter to flush output.- See Also:
-
VSWITCH
public static final int VSWITCHSwitch to a different shell layer.- See Also:
-
VSTATUS
public static final int VSTATUSPrints system status line (load, command, pid, etc).- See Also:
-
VDISCARD
public static final int VDISCARDToggles the flushing of terminal output.- See Also:
-
IGNPAR
public static final int IGNPARThe ignore parity flag. The parameter SHOULD be 0 if this flag is FALSE, and 1 if it is TRUE.- See Also:
-
PARMRK
public static final int PARMRKMark parity and framing errors.- See Also:
-
INPCK
public static final int INPCKEnable checking of parity errors.- See Also:
-
ISTRIP
public static final int ISTRIPStrip 8th bit off characters.- See Also:
-
INLCR
public static final int INLCRMap NL into CR on input.- See Also:
-
IGNCR
public static final int IGNCRIgnore CR on input.- See Also:
-
ICRNL
public static final int ICRNLMap CR to NL on input.- See Also:
-
IUCLC
public static final int IUCLCTranslate uppercase characters to lowercase.- See Also:
-
IXON
public static final int IXONEnable output flow control.- See Also:
-
IXANY
public static final int IXANYAny char will restart after stop.- See Also:
-
IXOFF
public static final int IXOFFEnable input flow control.- See Also:
-
IMAXBEL
public static final int IMAXBELRing bell on input queue full.- See Also:
-
IUTF8
public static final int IUTF8Output is assumed to be UTF-8- See Also:
-
ISIG
public static final int ISIGEnable signals INTR, QUIT, [D]SUSP.- See Also:
-
ICANON
public static final int ICANONCanonicalize input lines.- See Also:
-
XCASE
public static final int XCASEEnable input and output of uppercase characters by preceding their lowercase equivalents with "\".- See Also:
-
ECHO
public static final int ECHOEnable echoing.- See Also:
-
ECHOE
public static final int ECHOEVisually erase chars.- See Also:
-
ECHOK
public static final int ECHOKKill character discards current line.- See Also:
-
ECHONL
public static final int ECHONLEcho NL even if ECHO is off.- See Also:
-
NOFLSH
public static final int NOFLSHDon't flush after interrupt.- See Also:
-
TOSTOP
public static final int TOSTOPStop background jobs from output.- See Also:
-
IEXTEN
public static final int IEXTENEnable extensions.- See Also:
-
ECHOCTL
public static final int ECHOCTLEcho control characters as ^(Char).- See Also:
-
ECHOKE
public static final int ECHOKEVisual erase for line kill.- See Also:
-
PENDIN
public static final int PENDINRetype pending input.- See Also:
-
OPOST
public static final int OPOSTEnable output processing.- See Also:
-
OLCUC
public static final int OLCUCConvert lowercase to uppercase.- See Also:
-
ONLCR
public static final int ONLCRMap NL to CR-NL.- See Also:
-
OCRNL
public static final int OCRNLTranslate carriage return to newline (output).- See Also:
-
ONOCR
public static final int ONOCRTranslate newline to carriage return-newline (output).- See Also:
-
ONLRET
public static final int ONLRETNewline performs a carriage return (output).- See Also:
-
CS7
public static final int CS77 bit mode.- See Also:
-
CS8
public static final int CS88 bit mode.- See Also:
-
PARENB
public static final int PARENBParity enable.- See Also:
-
PARODD
public static final int PARODDOdd parity, else even.- See Also:
-
TTY_OP_ISPEED
public static final int TTY_OP_ISPEEDSpecifies the input baud rate in bits per second.- See Also:
-
TTY_OP_OSPEED
public static final int TTY_OP_OSPEEDSpecifies the output baud rate in bits per second.- See Also:
-
-
Constructor Details
-
PseudoTerminalModes
Deprecated, for removal: This API element is subject to removal in a future version.Construct a new empty set of modes, and usesetTerminalMode(int, boolean)
andsetTerminalMode(int, int)
to set this modes. This is deprecated, usePseudoTerminalModes.PseudoTerminalModesBuilder
instead.- Parameters:
modes
-- Throws:
IOException
-
PseudoTerminalModes
@Deprecated(since="3.1.0", forRemoval=true) public PseudoTerminalModes(byte[] modes) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.Construct modes from the encoded modes data.- Parameters:
modes
-- Throws:
IOException
-
-
Method Details
-
reset
Deprecated, for removal: This API element is subject to removal in a future version.Clear the modes -
setTerminalMode
@Deprecated(since="3.1.0", forRemoval=true) public void setTerminalMode(int mode, int value) throws com.sshtools.common.ssh.SshException Deprecated, for removal: This API element is subject to removal in a future version.Set an integer value mode- Parameters:
mode
- intvalue
- int- Throws:
com.sshtools.common.ssh.SshException
-
setTerminalMode
@Deprecated(since="3.1.0", forRemoval=true) public void setTerminalMode(int mode, boolean value) throws com.sshtools.common.ssh.SshException Deprecated, for removal: This API element is subject to removal in a future version.Set a boolean value mode- Parameters:
mode
- intvalue
- boolean- Throws:
com.sshtools.common.ssh.SshException
-
toByteArray
public byte[] toByteArray()Returns the encoded modes for use by theSshSession
.- Returns:
- byte[]
-