Allocates a new pseudo-terminal.
You can later use fork or the spawn_async family of
functions to start a process on the PTY.
If using fork, you MUST call child_setup in the child.
If using spawn_async and friends, you MUST either use child_setup directly as the child setup function, or call child_setup from your own child setup function supplied.
When using spawn_sync with a custom child setup function, child_setup will be called before the supplied function; you must not call it again.
Also, you MUST pass the g_spawn_do_not_reap_child flag.
Note also that g_spawn_stdout_to_dev_null, g_spawn_stderr_to_dev_null , and g_spawn_child_inherits_stdin are not supported, since stdin, stdout and stderr of the child process will always be connected to the PTY.
Note that you should set the PTY's size using set_size before spawning the child process, so that the child process has the correct size from the start instead of starting with a default size and then shortly afterwards receiving a <literal>SIGWINCH</literal> signal. You should prefer using pty_new_sync which does this automatically.
| flags |
flags from PtyFlags |
| cancellable |
a Cancellable, or null |
|
a new Pty, or null on error with throws filled in |