diff options
-rw-r--r-- | surf.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -1037,7 +1037,17 @@ newwindow(Client *c, const Arg *a, int noembed) void spawn(Client *c, const Arg *a) { - g_spawn_async(NULL, (const gchar* const *)a->v, NULL, G_SPAWN_DEFAULT, NULL, NULL, NULL, NULL); + if (fork() == 0) { + if (dpy) + close(ConnectionNumber(dpy)); + close(pipein[0]); + close(pipeout[1]); + setsid(); + execvp(((char **)a->v)[0], (char **)a->v); + fprintf(stderr, "%s: execvp %s", argv0, ((char **)a->v)[0]); + perror(" failed"); + exit(1); + } } void |