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.
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.
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() spawn_async( null, {"nautilus", "~"}, null, SpawnFlags. SEARCH_ PATH, null, null);
{
Process.
}
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.