## IdeSubprocessLauncher IdeSubprocessLauncher |

## Functions

IdeSubprocessLauncher * | ide_subprocess_launcher_new ()
const gchar * | ide_subprocess_launcher_get_cwd ()
void | ide_subprocess_launcher_set_cwd ()
GSubprocessFlags | ide_subprocess_launcher_get_flags ()
void | ide_subprocess_launcher_set_flags ()
gboolean | ide_subprocess_launcher_get_run_on_host ()
void | ide_subprocess_launcher_set_run_on_host ()
void | ide_subprocess_launcher_append_path ()
gboolean | ide_subprocess_launcher_get_clear_env ()
void | ide_subprocess_launcher_set_clear_env ()
const gchar * const * | ide_subprocess_launcher_get_environ ()
void | ide_subprocess_launcher_set_environ ()
const gchar * | ide_subprocess_launcher_getenv ()
void | ide_subprocess_launcher_setenv ()
void | ide_subprocess_launcher_insert_argv ()
void | ide_subprocess_launcher_replace_argv ()
void | ide_subprocess_launcher_overlay_environment ()
const gchar * const * | ide_subprocess_launcher_get_argv ()
const gchar * | ide_subprocess_launcher_get_arg ()
void | ide_subprocess_launcher_push_args ()
void | ide_subprocess_launcher_push_argv ()
gchar * | ide_subprocess_launcher_pop_argv ()
void | ide_subprocess_launcher_set_argv ()
IdeSubprocess * | ide_subprocess_launcher_spawn ()
void | ide_subprocess_launcher_set_stdout_file_path ()
void | ide_subprocess_launcher_take_fd ()
void | ide_subprocess_launcher_take_stdin_fd ()
void | ide_subprocess_launcher_take_stdout_fd ()
void | ide_subprocess_launcher_take_stderr_fd ()
gboolean | ide_subprocess_launcher_get_needs_tty ()
gint | ide_subprocess_launcher_get_max_fd ()
void | ide_subprocess_launcher_join_args_for_sh_c ()

## Properties

gboolean | clean-env | Read / Write
gchar * | cwd | Read / Write
GStrv | environ | Read / Write
GSubprocessFlags | flags | Read / Write / Construct
gboolean | run-on-host | Read / Write

## Types and Values

#define | IDE_TYPE_SUBPROCESS_LAUNCHER
struct | IdeSubprocessLauncherClass
| IdeSubprocessLauncher

## Object Hierarchy

        GObject
        ╰── IdeSubprocessLauncher

## Description

## Functions

### ide_subprocess_launcher_new ()

    IdeSubprocessLauncher *
    ide_subprocess_launcher_new (GSubprocessFlags flags);

### ide_subprocess_launcher_get_cwd ()

    const gchar *
    ide_subprocess_launcher_get_cwd (IdeSubprocessLauncher *self);

### ide_subprocess_launcher_set_cwd ()

    void
    ide_subprocess_launcher_set_cwd (IdeSubprocessLauncher *self,
                                     const gchar *cwd);

### ide_subprocess_launcher_get_flags ()

    GSubprocessFlags
    ide_subprocess_launcher_get_flags (IdeSubprocessLauncher *self);

### ide_subprocess_launcher_set_flags ()

    void
    ide_subprocess_launcher_set_flags (IdeSubprocessLauncher *self,
                                       GSubprocessFlags flags);

### ide_subprocess_launcher_get_run_on_host ()

    gboolean
    ide_subprocess_launcher_get_run_on_host
                                   (IdeSubprocessLauncher *self);

Gets if the process should be executed on the host system. This might be useful for situations where running in a contained environment is not sufficient to perform the given task.

Currently, only flatpak is supported for breaking out of the containment zone and requires the application was built with --allow=devel.

#### Returns

`TRUE` if the process should be executed outside the containment zone.

Since: 3.32

### ide_subprocess_launcher_set_run_on_host ()

    void
    ide_subprocess_launcher_set_run_on_host
                                   (IdeSubprocessLauncher *self,
                                    gboolean run_on_host);

Sets the “run-on-host” property. See `ide_subprocess_launcher_get_run_on_host()` for more information.

Since: 3.32

### ide_subprocess_launcher_append_path ()

    void
    ide_subprocess_launcher_append_path (IdeSubprocessLauncher *self,
                                         const gchar *append_path);

### ide_subprocess_launcher_get_clear_env ()

    gboolean
    ide_subprocess_launcher_get_clear_env (IdeSubprocessLauncher *self);

### ide_subprocess_launcher_set_clear_env ()

    void
    ide_subprocess_launcher_set_clear_env (IdeSubprocessLauncher *self,
                                           gboolean clear_env);

### ide_subprocess_launcher_get_environ ()

    const gchar * const   *
    ide_subprocess_launcher_get_environ (IdeSubprocessLauncher *self);

### ide_subprocess_launcher_set_environ ()

    void
    ide_subprocess_launcher_set_environ (IdeSubprocessLauncher *self,
                                         const gchar * const *environ_);

Replace the environment variables by a new list of variables.

#### Parameters

self | an IdeSubprocessLauncher |
environ_ | the list of environment variables to set. | [array zero-terminated=1][element-type utf8][nullable]

Since: 3.32

### ide_subprocess_launcher_getenv ()

    const gchar *
    ide_subprocess_launcher_getenv (IdeSubprocessLauncher *self,
                                    const gchar *key);

### ide_subprocess_launcher_setenv ()

    void
    ide_subprocess_launcher_setenv (IdeSubprocessLauncher *self,
                                    const gchar *key,
                                    const gchar *value,
                                    gboolean replace);

### ide_subprocess_launcher_insert_argv ()

    void
    ide_subprocess_launcher_insert_argv (IdeSubprocessLauncher *self,
                                         guint index,
                                         const gchar *arg);

### ide_subprocess_launcher_replace_argv ()

    void
    ide_subprocess_launcher_replace_argv (IdeSubprocessLauncher *self,
                                          guint index,
                                          const gchar *arg);

### ide_subprocess_launcher_overlay_environment ()

    void
    ide_subprocess_launcher_overlay_environment
                                   (IdeSubprocessLauncher *self,
                                    IdeEnvironment *environment);

### ide_subprocess_launcher_get_argv ()

    const gchar * const   *
    ide_subprocess_launcher_get_argv (IdeSubprocessLauncher *self);

### ide_subprocess_launcher_get_arg ()

    const gchar *
    ide_subprocess_launcher_get_arg (IdeSubprocessLauncher *self,
                                     guint pos);

### ide_subprocess_launcher_push_args ()

    void
    ide_subprocess_launcher_push_args (IdeSubprocessLauncher *self,
                                       const gchar * const *args);

This function is semantically identical to calling `ide_subprocess_launcher_push_argv()` for each element of `args` .

If `args` is `NULL`, this function does nothing.

#### Parameters

self | an IdeSubprocessLauncher |
args | the arguments. | [array zero-terminated=1][element-type utf8][nullable]

Since: 3.32

### ide_subprocess_launcher_push_argv ()

    void
    ide_subprocess_launcher_push_argv (IdeSubprocessLauncher *self,
                                       const gchar *argv);

### ide_subprocess_launcher_pop_argv ()

    gchar *
    ide_subprocess_launcher_pop_argv (IdeSubprocessLauncher *self);

### ide_subprocess_launcher_set_argv ()

    void
    ide_subprocess_launcher_set_argv (IdeSubprocessLauncher *self,
                                      const gchar * const *argv);

### ide_subprocess_launcher_spawn ()

    IdeSubprocess *
    ide_subprocess_launcher_spawn (IdeSubprocessLauncher *self,
                                   GCancellable *cancellable,
                                   GError **error);

Synchronously spawn a process using the internal state.

#### Returns

an IdeSubprocess or `NULL` upon error.

[transfer full]

Since: 3.32

### ide_subprocess_launcher_set_stdout_file_path ()

    void
    ide_subprocess_launcher_set_stdout_file_path
                                   (IdeSubprocessLauncher *self,
                                    const gchar *stdout_file_path);

### ide_subprocess_launcher_take_fd ()

    void
    ide_subprocess_launcher_take_fd (IdeSubprocessLauncher *self,
                                     gint source_fd,
                                     gint dest_fd);

### ide_subprocess_launcher_take_stdin_fd ()

    void
    ide_subprocess_launcher_take_stdin_fd (IdeSubprocessLauncher *self,
                                           gint stdin_fd);

### ide_subprocess_launcher_take_stdout_fd ()

    void
    ide_subprocess_launcher_take_stdout_fd
                                   (IdeSubprocessLauncher *self,
                                    gint stdout_fd);

### ide_subprocess_launcher_take_stderr_fd ()

    void
    ide_subprocess_launcher_take_stderr_fd
                                   (IdeSubprocessLauncher *self,
                                    gint stderr_fd);

### ide_subprocess_launcher_get_needs_tty ()

    gboolean
    ide_subprocess_launcher_get_needs_tty (IdeSubprocessLauncher *self);

### ide_subprocess_launcher_get_max_fd ()

    gint
    ide_subprocess_launcher_get_max_fd (IdeSubprocessLauncher *self);

Gets the hightest number of FD that has been mapped into the subprocess launcher.

This will always return a value >= 2 (to indicate stdin/stdout/stderr).

#### Parameters

self | a IdeSubprocessLauncher |

#### Returns

an integer for the max-fd

Since: 3.34

### ide_subprocess_launcher_join_args_for_sh_c ()

    void
    ide_subprocess_launcher_join_args_for_sh_c
                                   (IdeSubprocessLauncher *self,
                                    guint start_pos);

## Types and Values

### IDE_TYPE_SUBPROCESS_LAUNCHER

    #define IDE_TYPE_SUBPROCESS_LAUNCHER (ide_subprocess_launcher_get_type())

### struct IdeSubprocessLauncherClass

    struct IdeSubprocessLauncherClass {
      GObjectClass parent_class;

      IdeSubprocess *(*spawn) (IdeSubprocessLauncher  *self,
                               GCancellable           *cancellable,
                               GError                **error);
    };

### IdeSubprocessLauncher

    typedef struct _IdeSubprocessLauncher IdeSubprocessLauncher;

## Property Details

### The `“clean-env”` property

      “clean-env”                gboolean

If the environment should be cleared before setting environment variables.

Owner: IdeSubprocessLauncher

Flags: Read / Write

Default value: FALSE

### The `“cwd”` property

      “cwd”                      gchar *

Current Working Directory.

Owner: IdeSubprocessLauncher

Flags: Read / Write

Default value: NULL

### The `“environ”` property

      “environ”                  GStrv

Environ.

Owner: IdeSubprocessLauncher

Flags: Read / Write

### The `“flags”` property

      “flags”                    GSubprocessFlags

Flags.

Owner: IdeSubprocessLauncher

Flags: Read / Write / Construct

### The `“run-on-host”` property

      “run-on-host”              gboolean

Run on Host.

Owner: IdeSubprocessLauncher

Flags: Read / Write

Default value: FALSE