I am creating an application in C which I have to execute the firefox with the command execlp
but every time I execute it I "lost" my current terminal, but after the execlp
i still need to use the terminal which I was before, so my question is: Is there a way where I can be in one terminal call execlp
and it executes in another one without block the one I am on?
here is a snippet of my code:
pid_t child = fork();
if (child == -1) {
perror("fork error");
} else if (child == 0) {
exec_pid = getpid();
execlp("firefox", "firefox", URL, NULL);
perror("exec error");
}
// keep with program logic