Comment 2 for bug 734762

Revision history for this message
Bilal Akhtar (bilalakhtar) wrote :

The problem here is that GLib.Process.spawn_async automatically prepends the current working directory to any args string specified which begins with '~'. I have tried all possible solutions with the below tiny vala app and have failed.

using GLib.Process;

static void main()
{
    Process.spawn_async(null, {"nautilus", "~"}, null, SpawnFlags.SEARCH_PATH, null, null);
}

We could manually check before the call to spawn_async and replace all args strings beginning with ~, with the home directory itself. This will be more of a workaround than a fix. No SpawnFlags are there to avoid GLib from the substitution, so this seems to be the only solution.