the name of a directory the command should start in, or null to use the current working directory
child's argument vector
a list of environment variables to be added to the environment before starting the process, or null
an array of file descriptors, or null
an array of integers, or null
flags from #GSpawnFlags
an extra child setup function to run in the child just before exec(), or null
a timeout value in ms, -1 for the default timeout, or G_MAXINT to wait indefinitely
a #GCancellable, or null
a #GAsyncReadyCallback, or null
Starts the specified command under the pseudo-terminal pty. The argv and envv lists should be null-terminated. The "TERM" environment variable is automatically set to a default value, but can be overridden from envv. pty_flags controls logging the session to the specified system log files.
Note also that G_SPAWN_STDOUT_TO_DEV_NULL, G_SPAWN_STDERR_TO_DEV_NULL, and G_SPAWN_CHILD_INHERITS_STDIN are not supported in spawn_flags, since stdin, stdout and stderr of the child process will always be connected to the PTY. Also G_SPAWN_LEAVE_DESCRIPTORS_OPEN is not supported; and G_SPAWN_DO_NOT_REAP_CHILD will always be added to spawn_flags.
If fds is not null, the child process will map the file descriptors from fds according to map_fds; n_map_fds must be less or equal to n_fds. This function will take ownership of the file descriptors in fds; you must not use or close them after this call. All file descriptors in fds must have the FD_CLOEXEC flag set on them; it will be unset in the child process before calling man:execve(2). Note also that no file descriptor may be mapped to stdin, stdout, or stderr (file descriptors 0, 1, or 2), since these will be assigned to the PTY. All open file descriptors apart from those mapped as above will be closed when execve() is called.
Beginning with 0.60, and on linux only, and unless VTE_SPAWN_NO_SYSTEMD_SCOPE is passed in spawn_flags, the newly created child process will be moved to its own systemd user scope; and if VTE_SPAWN_REQUIRE_SYSTEMD_SCOPE is passed, and creation of the systemd user scope fails, the whole spawn will fail. You can override the options used for the systemd user scope by providing a systemd override file for 'vte-spawn-.scope' unit. See man:systemd.unit(5) for further information.
See vte_pty_new(), and vte.terminal.Terminal.watchChild for more information.