public class PseudoTerminal:
Interactive pseudo-terminal backed by the operating system terminal API.
PseudoTerminal is intended for embedded terminals and interactive tools: shells, Python REPLs, debuggers, package managers and any process that expects a real TTY instead of plain redirected pipes.
pty = PseudoTerminal()
pty.write("python3 -i\n")
output = pty.readAvailable()| Modifier and Type | Member | Description |
|---|---|---|
| public readonly property | isRunningisRunning as Boolean: |
Indicates whether the terminal child process is still running. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | PseudoTerminalPseudoTerminal(command as String = "", cwd as String = "", columns as Int = 80, rows as Int = 24): |
Starts a new pseudo-terminal. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | closeclose() as Void: |
Closes the terminal and terminates the child process if it is still alive. |
| public | readAvailablereadAvailable() as String: |
Reads all output currently available without blocking the GUI thread. |
| public | resize | Resizes the terminal grid. |
| public | start | Starts the terminal process. |
| public | writewrite(text as String) as Void: |
Writes text to the terminal input stream. |