Package org.eclipse.cdt.utils.pty
Class PTY
java.lang.Object
org.eclipse.cdt.utils.pty.PTY
- Direct Known Subclasses:
PersistentPTY
PTY - pseudo terminal support.
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
The master fd is used on two streams.static enum
The pty modes. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
final boolean
static boolean
Deprecated.static boolean
isSupported
(PTY.Mode mode) final void
setTerminalSize
(int width, int height) Change terminal window size to given width and height.void
Test whether the slave name can be used as a tty device by external processes (e.g.int
-
Constructor Details
-
PTY
Create PTY for use with Eclipse console. Identical toPTY(Mode.CONSOLE)
.- Throws:
IOException
-
PTY
Create PTY for given mode.The provided mode indicates whether the pseudo terminal is used with the interactive Eclipse console or a terminal emulation:
CONSOLE
- the terminal is configured with no echo and stderr is redirected to a pipe instead of the PTY. This mode is not supported on windowsTERMINAL
- the terminal is configured with echo and stderr is connected to the PTY. This mode is best suited for use with a proper terminal emulation. Note that this mode might not be supported on all platforms. Known platforms which support this mode are:linux-x86
,linux-x86_64
,solaris-sparc
,macosx
.
- Parameters:
mode
- the desired mode of operation- Throws:
IOException
- if the PTY could not be created- Since:
- 5.6
-
-
Method Details
-
isSupported
Deprecated.- Returns:
- whether PTY support for console mode is available on this platform
-
isSupported
- Returns:
- whether PTY support for given mode is available on this platform
- Since:
- 5.6
-
validateSlaveName
Test whether the slave name can be used as a tty device by external processes (e.g. gdb). If the slave name is not valid an IOException is thrown.- Throws:
IOException
- if the slave name is not valid- Since:
- 5.6
-
getSlaveName
-
getMasterFD
-
isConsole
public final boolean isConsole()- Returns:
- whether this pseudo terminal is for use with the Eclipse console.
- Since:
- 5.2
-
getOutputStream
-
getInputStream
-
setTerminalSize
public final void setTerminalSize(int width, int height) Change terminal window size to given width and height.This should only be used when the pseudo terminal is configured for use with a terminal emulation, i.e. when
isConsole()
returnsfalse
.Note: This method may not be supported on all platforms. Known platforms which support this method are:
linux-x86
,linux-x86_64
,solaris-sparc
,macosx
.- Since:
- 5.2
-
exec_pty
public int exec_pty(Spawner spawner, String[] cmdarray, String[] envp, String dir, Spawner.IChannel[] chan) throws IOException - Throws:
IOException
- Since:
- 5.6
- Restriction:
- This method is not intended to be referenced by clients.
-
waitFor
- Since:
- 5.6
- Restriction:
- This method is not intended to be referenced by clients.
-