Provide correct arguments to execvp

Previously no arguments were provided, but by convention argv[0] should
be the name of the program.

Providing this argumens enables Psuedoterminal node to work on macOS.
This commit is contained in:
Leroy Hopson 2020-11-21 12:02:29 +07:00 committed by Leroy Hopson
parent b2dc46636c
commit 570896b9c0

View file

@ -1,7 +1,8 @@
#include "pseudoterminal.h"
#include <unistd.h>
#include <libgen.h>
#include <sys/wait.h>
#include <termios.h>
#include <unistd.h>
// Platform specific includes.
#if defined(PLATFORM_LINUX)
@ -77,7 +78,8 @@ void Pseudoterminal::process_pty()
putenv(colortermenv);
char *shell = getenv("SHELL");
execvp(shell, NULL);
char *argv[] = { basename(shell), NULL };
execvp(shell, argv);
}
else
{
@ -171,4 +173,4 @@ void Pseudoterminal::resize(Vector2 new_size)
{
std::lock_guard<std::mutex> guard(size_mutex);
size = new_size;
}
}