Constructor
VtePtynew_sync
Declaration [src]
VtePty*
vte_pty_new_sync (
VtePtyFlags flags,
GCancellable* cancellable,
GError** error
)
Description [src]
Allocates a new pseudo-terminal.
You can later use fork()
or the g_spawn_async()
family of functions
to start a process on the PTY.
If using fork(), you MUST call vte_pty_child_setup()
in the child.
If using g_spawn_async()
and friends, you MUST either use
vte_pty_child_setup()
directly as the child setup function, or call
vte_pty_child_setup()
from your own child setup function supplied.
When using vte_terminal_spawn_sync()
with a custom child setup
function, vte_pty_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 vte_pty_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 vte_terminal_pty_new_sync()
which does this automatically.
Parameters
flags |
VtePtyFlags |
Flags from |
|
cancellable |
GCancellable |
A |
|
The argument can be NULL . | |
The data is owned by the caller of the function. | |
error |
GError ** |
The return location for a GError* , or NULL . |
Return value
Returns: | VtePty |
A new |
|
The caller of the function takes ownership of the data, and is responsible for freeing it. |