Package ghidra.pty
Interface PtyChild
- All Superinterfaces:
PtyEndpoint
- All Known Implementing Classes:
ConPtyChild
,SshPtyChild
,UnixPtyChild
The child (UNIX "slave") end of a pseudo-terminal
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Mode flag for local echostatic interface
A terminal mode flag -
Method Summary
Modifier and TypeMethodDescriptiondefault String
nullSession
(PtyChild.TermMode... mode) Start a session without a real leader, instead obtaining the pty's namedefault PtySession
default PtySession
session
(String[] args, Map<String, String> env, File workingDirectory, Collection<PtyChild.TermMode> mode) Spawn a subprocess in a new session whose controlling tty is this pseudo-terminalvoid
setWindowSize
(short cols, short rows) Resize the terminal window to the given width and height, in charactersMethods inherited from interface ghidra.pty.PtyEndpoint
getInputStream, getOutputStream
-
Method Details
-
session
PtySession session(String[] args, Map<String, String> env, File workingDirectory, Collection<PtyChild.TermMode> mode) throws IOExceptionSpawn a subprocess in a new session whose controlling tty is this pseudo-terminalThis method or
nullSession(Collection)
can only be invoked once per pty.- Parameters:
args
- the image path and argumentsenv
- the environmentworkingDirectory
- the working directorymode
- the terminal mode. If a mode is not implemented, it may be silently ignored.- Returns:
- a handle to the subprocess
- Throws:
IOException
- if the session could not be started
-
session
default PtySession session(String[] args, Map<String, String> env, File workingDirectory, PtyChild.TermMode... mode) throws IOException- Throws:
IOException
- See Also:
-
session
default PtySession session(String[] args, Map<String, String> env, PtyChild.TermMode... mode) throws IOException- Throws:
IOException
- See Also:
-
nullSession
Start a session without a real leader, instead obtaining the pty's nameThis method or any other
session
method can only be invoked once per pty. It must be called before anyone reads the parent's output stream, since obtaining the filename may be implemented by the parent sending commands to its child.If the child end of the pty is on a remote system, this should be the file (or other resource) name as it would be accessed on that remote system.
- Parameters:
mode
- the terminal mode. If a mode is not implemented, it may be silently ignored.- Returns:
- the file name
- Throws:
IOException
- if the session could not be started or the pty name could not be determined
-
nullSession
- Throws:
IOException
- See Also:
-
setWindowSize
void setWindowSize(short cols, short rows) Resize the terminal window to the given width and height, in characters- Parameters:
cols
- the width in charactersrows
- the height in characters
-