diff --git a/Info.plist b/Info.plist
index 84b270f0..7369e2eb 100644
--- a/Info.plist
+++ b/Info.plist
@@ -18,6 +18,11 @@
@SHORT_VERSION@
CFBundleShortVersionString
@SHORT_VERSION@
+ LSEnvironment
+
+ GUI_LAUNCHED
+
+
CFBundleDocumentTypes
diff --git a/src/openscad.cc b/src/openscad.cc
index 0a62463f..3050c264 100644
--- a/src/openscad.cc
+++ b/src/openscad.cc
@@ -582,8 +582,9 @@ int gui(const vector &inputFiles, const fs::path &original_path, int arg
int main(int argc, char **argv)
{
int rc = 0;
+ bool isGuiLaunched = getenv("GUI_LAUNCHED") != 0;
#ifdef Q_OS_MAC
- set_output_handler(CocoaUtils::nslog, NULL);
+ if (isGuiLaunched) set_output_handler(CocoaUtils::nslog, NULL);
#endif
#ifdef ENABLE_CGAL
// Causes CGAL errors to abort directly instead of throwing exceptions