diff --git a/lib/API/schema.json b/lib/API/schema.json index a74b138e3..d650a73d7 100644 --- a/lib/API/schema.json +++ b/lib/API/schema.json @@ -213,5 +213,9 @@ "instance_var": { "type": "string", "default" : "NODE_APP_INSTANCE" +}, + "windowsHide": { + "type": "boolean", + "default" : true } } diff --git a/lib/God/ForkMode.js b/lib/God/ForkMode.js index 870519962..d5ac57bcb 100644 --- a/lib/God/ForkMode.js +++ b/lib/God/ForkMode.js @@ -90,11 +90,17 @@ module.exports = function ForkMode(God) { return cb(err); }; + var windowsHide; + if (typeof(pm2_env.windowsHide) === "boolean") { + windowsHide = pm2_env.windowsHide; + } else { + windowsHide = true; + } try { var cspr = spawn(command, args, { env : pm2_env, detached : true, - windowsHide: true, + windowsHide: windowsHide, cwd : pm2_env.pm_cwd || process.cwd(), stdio : ['pipe', 'pipe', 'pipe', 'ipc'] //Same as fork() in node core });