### Function

# Ide path_collapse

#### Declaration

    gchar*
    ide_path_collapse (
      const gchar* path
    )

#### Description

This function will collapse a path that starts with the users home directory into a shorthand notation using ~/ for the home directory.

If the path does not have the home directory as a prefix, it will simply return a copy of `path`.

Available since: | 3.32

#### Parameters

`path` | `const gchar*`
| No description available.
| The data is owned by the caller of the function.
| The value is a NUL terminated UTF-8 string.

#### Return value

Returns: | `gchar*`
| A new path, possibly collapsed.
| The caller of the function takes ownership of the data, and is responsible for freeing it.
| The value is a NUL terminated UTF-8 string.