diff --git a/agents/meshcore.js b/agents/meshcore.js index 974599fb..afc00158 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -94,6 +94,21 @@ if (process.platform == 'win32' && require('user-sessions').isRoot()) { } catch (e) { } } +if (process.platform != 'win32') +{ + var ch = require('child_process'); + ch._execFile = ch.execFile; + ch.execFile = function execFile(path, args, options) + { + if(options && options.type && options.type == ch.SpawnTypes.TERM && options.env) + { + options.env['TERM'] = 'xterm-256color'; + } + return (this._execFile(path, args, options)); + }; +} + + if (process.platform == 'darwin' && !process.versions) { // This is an older MacOS Agent, so we'll need to check the service definition so that Auto-Update will function correctly var child = require('child_process').execFile('/bin/sh', ['sh']); diff --git a/agents/recoverycore.js b/agents/recoverycore.js index eda0d297..5ca19756 100644 --- a/agents/recoverycore.js +++ b/agents/recoverycore.js @@ -28,6 +28,20 @@ catch(x) } +if (process.platform != 'win32') +{ + var ch = require('child_process'); + ch._execFile = ch.execFile; + ch.execFile = function execFile(path, args, options) + { + if (options && options.type && options.type == ch.SpawnTypes.TERM && options.env) + { + options.env['TERM'] = 'xterm-256color'; + } + return (this._execFile(path, args, options)); + }; +} + function _getPotentialServiceNames() { var registry = require('win-registry');