## FmTerminal FmTerminal — Terminals representation for libfm. |

## Synopsis

    #define             FM_TERMINAL_TYPE
    struct              FmTerminal;
                        FmTerminalClass;
    FmTerminal *        fm_terminal_dup_default             (GError **error);
    gboolean            fm_terminal_launch                  (const gchar *dir,
                                                             GError **error);

## Object Hierarchy

      GObject
       +----FmTerminal

## Description

`include`: libfm/fm.h

The FmTerminal object represents description how applications which require start in terminal should be started.

## Details

### FM_TERMINAL_TYPE

    #define FM_TERMINAL_TYPE               (fm_terminal_get_type())

### struct FmTerminal

    struct FmTerminal {
        char* program;
        char* open_arg;
        char* noclose_arg;
        char* launch;
        char* desktop_id;
        char* custom_args;
    };

A terminal description. If application should be ran in terminal libfm may do it either default way (closing terminal window after exit):

- `program` `custom_args` `open_arg` <cmd> [<args>]

or alternate way (not closing terminal window after exit):

- `program` `custom_args` `noclose_arg` <cmd> [<args>]

If terminal doesn't support not closing terminal window after exit then default way should be used.

char *`program`; | archiver program
char *`open_arg`; | options to insert before <cmd> [<args>] to run command in terminal
char *`noclose_arg`; | options to insert to run command without closing terminal or `NULL`
char *`launch`; | options if required to launch in current directory
char *`desktop_id`; | desktop ID to search for icon and descriptions
char *`custom_args`; | custom arguments (only from libfm.conf)

### FmTerminalClass

    typedef struct _FmTerminalClass FmTerminalClass;

### fm_terminal_dup_default ()

    FmTerminal *        fm_terminal_dup_default             (GError **error);

Retrieves description of terminal which is defined in libfm config. Returned data should be freed with `g_object_unref()` after usage.

`error` : | location of error to set. [allow-none]
Returns : | terminal descriptor or `NULL` if no terminal is set. [transfer full]

Since 1.2.0

### fm_terminal_launch ()

    gboolean            fm_terminal_launch                  (const gchar *dir,
                                                             GError **error);

Spawns a terminal window in requested `dir`. If `dir` is `NULL` then it will be spawned in current working directory.

`dir` : | a directory to launch. [allow-none]
`error` : | location of error to set. [allow-none]
Returns : | `TRUE` if spawn was succesful.

Since 1.2.0