diff --git a/packages/node_modules/@node-red/nodes/core/function/90-exec.html b/packages/node_modules/@node-red/nodes/core/function/90-exec.html index c4d841a13..ea988a84a 100644 --- a/packages/node_modules/@node-red/nodes/core/function/90-exec.html +++ b/packages/node_modules/@node-red/nodes/core/function/90-exec.html @@ -40,6 +40,10 @@ +
+ + +
@@ -56,6 +60,7 @@ append: {value:""}, useSpawn: {value:"false"}, timer: {value:""}, + winHide: {value:false}, oldrc: {value:false}, name: {value:""} }, @@ -92,6 +97,12 @@ }); $("#node-input-addpay-cb").trigger("change") + + if (this.winHide === "true" || this.winHide === true) { + $("#node-input-winHide").prop("checked",true); + } else { + $("#node-input-winHide").prop("checked",false); + } }, oneditsave: function() { if (!$("#node-input-addpay-cb").prop("checked")) { diff --git a/packages/node_modules/@node-red/nodes/core/function/90-exec.js b/packages/node_modules/@node-red/nodes/core/function/90-exec.js index 9ec60f4ff..cf4168ae8 100644 --- a/packages/node_modules/@node-red/nodes/core/function/90-exec.js +++ b/packages/node_modules/@node-red/nodes/core/function/90-exec.js @@ -34,7 +34,8 @@ module.exports = function(RED) { this.timer = Number(n.timer || 0)*1000; this.activeProcesses = {}; this.oldrc = (n.oldrc || false).toString(); - this.execOpt = {encoding:'binary', maxBuffer:RED.settings.execMaxBufferSize||10000000}; + this.execOpt = {encoding:'binary', maxBuffer:RED.settings.execMaxBufferSize||10000000, windowsHide: (n.winHide === true)}; + this.spawnOpt = {windowsHide: (n.winHide === true) } var node = this; if (process.platform === 'linux' && fs.existsSync('/bin/bash')) { node.execOpt.shell = '/bin/bash'; } @@ -86,7 +87,7 @@ module.exports = function(RED) { var cmd = arg.shift(); /* istanbul ignore else */ if (RED.settings.verbose) { node.log(cmd+" ["+arg+"]"); } - child = spawn(cmd,arg); + child = spawn(cmd,arg,node.spawnOpt); node.status({fill:"blue",shape:"dot",text:"pid:"+child.pid}); var unknownCommand = (child.pid === undefined); if (node.timer !== 0) { diff --git a/packages/node_modules/@node-red/nodes/locales/en-US/function/90-exec.html b/packages/node_modules/@node-red/nodes/locales/en-US/function/90-exec.html index ff515e781..0a9f509bf 100644 --- a/packages/node_modules/@node-red/nodes/locales/en-US/function/90-exec.html +++ b/packages/node_modules/@node-red/nodes/locales/en-US/function/90-exec.html @@ -73,6 +73,7 @@

The returned payload is usually a string, unless non-UTF8 characters are detected, in which case it is a buffer.

The node's status icon and PID will be visible while the node is active. Changes to this can be read by the Status node.

+

The Hide console option will hide the process console normally shown on Windows systems.

Killing processes

Sending msg.kill will kill a single active process. msg.kill should be a string containing the type of signal to be sent, for example, SIGINT, SIGQUIT or SIGHUP. diff --git a/packages/node_modules/@node-red/nodes/locales/en-US/messages.json b/packages/node_modules/@node-red/nodes/locales/en-US/messages.json index a9e50a77d..f2ca607da 100755 --- a/packages/node_modules/@node-red/nodes/locales/en-US/messages.json +++ b/packages/node_modules/@node-red/nodes/locales/en-US/messages.json @@ -198,7 +198,8 @@ "seconds": "seconds", "stdout": "stdout", "stderr": "stderr", - "retcode": "return code" + "retcode": "return code", + "winHide": "Hide console" }, "placeholder": { "extraparams": "extra input parameters" diff --git a/test/nodes/core/function/90-exec_spec.js b/test/nodes/core/function/90-exec_spec.js index b21409c23..247a7876c 100644 --- a/test/nodes/core/function/90-exec_spec.js +++ b/test/nodes/core/function/90-exec_spec.js @@ -44,6 +44,8 @@ describe('exec node', function() { n1.should.have.property("addpay","payload"); n1.should.have.property("timer",0); n1.should.have.property("oldrc","false"); + n1.should.have.property("execOpt", {encoding:'binary', maxBuffer:10000000, windowsHide: false}); + n1.should.have.property("spawnOpt", {windowsHide:false}); done(); }); });