diff --git a/DevTools/HackStudio/TerminalWrapper.cpp b/DevTools/HackStudio/TerminalWrapper.cpp index 001a470a2a..75208c7497 100644 --- a/DevTools/HackStudio/TerminalWrapper.cpp +++ b/DevTools/HackStudio/TerminalWrapper.cpp @@ -105,7 +105,6 @@ void TerminalWrapper::run_command(const String& command) } setenv("TERM", "xterm", true); - setenv("PATH", "/bin:/usr/bin:/usr/local/bin", true); auto parts = command.split(' '); ASSERT(!parts.is_empty()); diff --git a/DevTools/HackStudio/main.cpp b/DevTools/HackStudio/main.cpp index f88c0bc2fd..d7008a55b4 100644 --- a/DevTools/HackStudio/main.cpp +++ b/DevTools/HackStudio/main.cpp @@ -10,6 +10,7 @@ #include "TerminalWrapper.h" #include "WidgetTool.h" #include "WidgetTreeModel.h" +#include #include #include #include @@ -121,6 +122,13 @@ int main(int argc, char** argv) widget->set_layout(make(Orientation::Vertical)); widget->layout()->set_spacing(0); + StringBuilder path; + path.append(getenv("PATH")); + if (path.length()) + path.append(":"); + path.append("/bin:/usr/bin:/usr/local/bin"); + setenv("PATH", path.to_string().characters(), true); + if (!make_is_available()) GMessageBox::show("The 'make' command is not available. You probably want to install the binutils, gcc, and make ports from the root of the Serenity repository.", "Error", GMessageBox::Type::Error, GMessageBox::InputType::OK, g_window);