From 5baffd0b0c45d0f03aaf3a92846f833bfc969acc Mon Sep 17 00:00:00 2001 From: Leroy Hopson Date: Sat, 21 Nov 2020 12:02:29 +0700 Subject: [PATCH] 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. --- addons/godot_xterm/native/src/pseudoterminal.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/godot_xterm/native/src/pseudoterminal.cpp b/addons/godot_xterm/native/src/pseudoterminal.cpp index bf3fdda..a13594f 100644 --- a/addons/godot_xterm/native/src/pseudoterminal.cpp +++ b/addons/godot_xterm/native/src/pseudoterminal.cpp @@ -1,7 +1,8 @@ #include "pseudoterminal.h" -#include +#include #include #include +#include // 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 guard(size_mutex); size = new_size; -} \ No newline at end of file +}