Node for forking processes (e.g. bash, nodejs, python) with pseudoterminal file descriptors.
Can be used with the [Terminal] node to get an actual shell.
Not currently supported on Windows, but it could be in the future using [ConPTY](https://docs.microsoft.com/en-us/windows/console) or [WinPTY](https://github.com/rprichard/winpty).
See issue [\#25](https://github.com/lihop/godot-xterm/issues/25).
<sub>"PTY Diagram" is a derivative of [Termios-script-diagram.svg](https://commons.wikimedia.org/wiki/File:Termios-script-diagram.svg) by [Krishnavedala](https://en.wikipedia.org/wiki/User:Krishnavedala?rdfrom=commons:User:Krishnavedala), used under [CC0](https://creativecommons.org/share-your-work/public-domain/cc0/).
| void | [write](#mthd-write) **(** [String]\|[PoolByteArray] data **)** |
## Signals
-<aname="sgnl-data_received"/>**data_received****(** [PoolByteArray] data **)**
Emitted when data is read from the pseudoterminal master device.
---
-<aname="sgnl-exited"/>**exited****(** [int] exit_code, [int] signum **)**
Emitted when the child program exits. `exit_code` is the exit status of the child program and `signum` is the number of the signal that terminated the child program.
[NodePath] to a [Terminal]. Setting this path will automatically connect the appropriate signals of both nodes for standard operation. It will also disconnected the signals of the previously set terminal, if any.
Environment variables to be set for the child program.
---
-<aname="prop-use_os_env"/> [bool] **use_os_env**
| | |
|-----------|--------|
| *Default* | `true` |
| *Setter* | None |
| *Getter* | None |
If `true` the environment variables from `env` will be merged with the environment variables of the current program (i.e. Godot), with the variables from `env` taking precedence over the environment variables of the current program.
Opens a pseudoterminal and starts a new process using the program specified by `file`.
`file` defaults to the value of the `SHELL` environment variable, falling back to `sh`.
The arguments specified in `args` are passed to the program.
`cwd` is the directory in which the program will be executed. Defaults to the working directory of the current program (typically the project directory, when running from editor).
`cols` is the initial number of columns and `rows` is the initial number of rows.
Returns [OK] if successful.
See also Godot's [OS.execute()](https://docs.godotengine.org/en/stable/classes/class_os.html#class-os-method-execute) method.