Terminal.forkCommandFull

Starts the specified command under a newly-allocated controlling pseudo-terminal. The argv and envv lists should be NULL-terminated. The "TERM" environment variable is automatically set to reflect the terminal widget's emulation setting. pty_flags controls logging the session to the specified system log files. Note that G_SPAWN_DO_NOT_REAP_CHILD will always be added to spawn_flags. Note that unless spawn_flags contains G_SPAWN_LEAVE_DESCRIPTORS_OPEN, all file descriptors except stdin/stdout/stderr will be closed before calling exec() in the child. See vte_pty_new(), g_spawn_async() and vte_terminal_watch_child() for more information.

class Terminal
int
forkCommandFull

Parameters

ptyFlags VtePtyFlags

flags from VtePtyFlags

workingDirectory string

the name of a directory the command should start in, or NULL to use the current working directory. [allow-none]

argv string[]

child's argument vector. [array zero-terminated=1][element-type filename]

envv string[]

a list of environment variables to be added to the environment before starting the process, or NULL. [allow-none][array zero-terminated=1][element-type filename]

spawnFlags GSpawnFlags

flags from GSpawnFlags

childSetup GSpawnChildSetupFunc

an extra child setup function to run in the child just before exec(), or NULL. [allow-none][scope call]

childSetupData void*

user data for child_setup

childPid GPid

a location to store the child PID, or NULL. out[allow-none][transfer full]

Return Value

Type: int

TRUE on success, or FALSE on error with error filled in Since 0.26

Throws

GException on failure.

Meta