public class PseudoTerminalModes extends Object
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.
SshSession session = ssh.openSessionChannel(); PseudoTerminalModes modes = new PseudoTerminalModes(ssh); // Turning off echo modes.setTerminalMode(PseudoTerminalModes.ECHO, false); // Setting the Input/Output baud rate modes.setTerminalMode(PseudoTerminalModes.TTY_OP_ISPEED, 38400); modes.setTerminalMode(PseudoTerminalModes.TTY_OP_OSPEED, 38400); session.requestPseudoTerminal("vt100", 80, 24, 0, 0, modes);
You can reuse an instance of this class providing that you do not want to change any of the modes. If you do want to change modes you can call the reset method to clear out old modes.
Modifier and Type | Field and Description |
---|---|
static int |
CS7
7 bit mode.
|
static int |
CS8
8 bit mode.
|
static int |
ECHO
Enable echoing.
|
static int |
ECHOCTL
Echo control characters as ^(Char).
|
static int |
ECHOE
Visually erase chars.
|
static int |
ECHOK
Kill character discards current line.
|
static int |
ECHOKE
Visual erase for line kill.
|
static int |
ECHONL
Echo NL even if ECHO is off.
|
static int |
ICANON
Canonicalize input lines.
|
static int |
ICRNL
Map CR to NL on input.
|
static int |
IEXTEN
Enable extensions.
|
static int |
IGNCR
Ignore CR on input.
|
static int |
IGNPAR
The ignore parity flag.
|
static int |
IMAXBEL
Ring bell on input queue full.
|
static int |
INLCR
Map NL into CR on input.
|
static int |
INPCK
Enable checking of parity errors.
|
static int |
ISIG
Enable signals INTR, QUIT, [D]SUSP.
|
static int |
ISTRIP
Strip 8th bit off characters.
|
static int |
IUCLC
Translate uppercase characters to lowercase.
|
static int |
IUTF8
Ring bell on input queue full.
|
static int |
IXANY
Any char will restart after stop.
|
static int |
IXOFF
Enable input flow control.
|
static int |
IXON
Enable output flow control.
|
static int |
NOFLSH
Don't flush after interrupt.
|
static int |
OCRNL
Translate carriage return to newline (output).
|
static int |
OLCUC
Convert lowercase to uppercase.
|
static int |
ONLCR
Map NL to CR-NL.
|
static int |
ONLRET
Newline performs a carriage return (output).
|
static int |
ONOCR
Translate newline to carriage return-newline (output).
|
static int |
OPOST
Enable output processing.
|
static int |
PARENB
Parity enable.
|
static int |
PARMRK
Mark parity and framing errors.
|
static int |
PARODD
Odd parity, else even.
|
static int |
PENDIN
Retype pending input.
|
static int |
TOSTOP
Stop background jobs from output.
|
static int |
TTY_OP_ISPEED
Specifies the input baud rate in bits per second.
|
static int |
TTY_OP_OSPEED
Specifies the output baud rate in bits per second.
|
static int |
VDISCARD
Toggles the flushing of terminal output.
|
static int |
VDSUSP
Another suspend character.
|
static int |
VEOF
End-of-file character (sends EOF from the terminal).
|
static int |
VEOL
End-of-line character in addition to carriage return and/or linefeed.
|
static int |
VEOL2
Additional end-of-line character.
|
static int |
VERASE
Erase the character to left of the cursor.
|
static int |
VFLUSH
Character to flush output.
|
static int |
VINTR
Interrupt character; 255 if none.
|
static int |
VKILL
Kill the current input line.
|
static int |
VLNEXT
Enter the next character typed literally, even if it is a special character
|
static int |
VQUIT
The quit character (sends SIGQUIT signal on POSIX systems).
|
static int |
VREPRINT
Reprints the current input line.
|
static int |
VSTART
Continues paused output (normally control-Q).
|
static int |
VSTATUS
Prints system status line (load, command, pid, etc).
|
static int |
VSTOP
Pauses output (normally control-S).
|
static int |
VSUSP
Suspends the current program.
|
static int |
VSWITCH
Switch to a different shell layer.
|
static int |
VWERASE
Erases a word left of cursor.
|
static int |
XCASE
Enable input and output of uppercase characters by preceding their lowercase
equivalents with "\".
|
Constructor and Description |
---|
PseudoTerminalModes(SshClient client) |
Modifier and Type | Method and Description |
---|---|
void |
reset()
Clear the modes
|
void |
setTerminalMode(int mode,
boolean value)
Set a boolean value mode
|
void |
setTerminalMode(int mode,
int value)
Set an integer value mode
|
byte[] |
toByteArray()
Returns the encoded modes for use by the
SshSession . |
public static final int VINTR
public static final int VQUIT
public static final int VERASE
public static final int VKILL
public static final int VEOF
public static final int VEOL
public static final int VEOL2
public static final int VSTART
public static final int VSTOP
public static final int VSUSP
public static final int VDSUSP
public static final int VREPRINT
public static final int VWERASE
public static final int VLNEXT
public static final int VFLUSH
public static final int VSWITCH
public static final int VSTATUS
public static final int VDISCARD
public static final int IGNPAR
public static final int PARMRK
public static final int INPCK
public static final int ISTRIP
public static final int INLCR
public static final int IGNCR
public static final int ICRNL
public static final int IUCLC
public static final int IXON
public static final int IXANY
public static final int IXOFF
public static final int IMAXBEL
public static final int IUTF8
public static final int ISIG
public static final int ICANON
public static final int XCASE
public static final int ECHO
public static final int ECHOE
public static final int ECHOK
public static final int ECHONL
public static final int NOFLSH
public static final int TOSTOP
public static final int IEXTEN
public static final int ECHOCTL
public static final int ECHOKE
public static final int PENDIN
public static final int OPOST
public static final int OLCUC
public static final int ONLCR
public static final int OCRNL
public static final int ONOCR
public static final int ONLRET
public static final int CS7
public static final int CS8
public static final int PARENB
public static final int PARODD
public static final int TTY_OP_ISPEED
public static final int TTY_OP_OSPEED
public PseudoTerminalModes(SshClient client)
public void reset()
public void setTerminalMode(int mode, int value) throws SshException
mode
- intvalue
- intSshException
public void setTerminalMode(int mode, boolean value) throws SshException
mode
- intvalue
- booleanSshException
public byte[] toByteArray()
SshSession
.Copyright © 2024. All rights reserved.