mirror of
https://github.com/lihop/godot-xterm.git
synced 2024-11-10 04:40:25 +01:00
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:
parent
b2dc46636c
commit
570896b9c0
1 changed files with 5 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue