Terminal.spawnSync

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 a default value, but can be overridden from envv. 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 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.

Note that all open file descriptors will be closed in the child. If you want to keep some file descriptor open for use in the child process, you need to use a child setup function that unsets the FD_CLOEXEC flag on that file descriptor.

See vte_pty_new(), glib.global.spawnAsync and vte.terminal.Terminal.watchChild for more information.

Beginning with 0.52, sets PWD to working_directory in order to preserve symlink components. The caller should also make sure that symlinks were preserved while constructing the value of working_directory, e.g. by using vte.terminal.Terminal.getCurrentDirectoryUri, glib.global.getCurrentDir or get_current_dir_name().

More...

Parameters

ptyFlags vte.types.PtyFlags

flags from #VtePtyFlags

workingDirectory string

the name of a directory the command should start in, or null to use the current working directory

argv string[]

child's argument vector

envv string[]

a list of environment variables to be added to the environment before starting the process, or null

spawnFlags glib.types.SpawnFlags

flags from #GSpawnFlags

childSetup glib.types.SpawnChildSetupFunc

an extra child setup function to run in the child just before exec(), or null

childPid glib.types.Pid

a location to store the child PID, or null

cancellable gio.cancellable.Cancellable

a #GCancellable, or null

Return Value

Type: bool

true on success, or false on error with error filled in

Detailed Description

Deprecated: Use vte.terminal.Terminal.spawnAsync instead.