From 189941bd44f69f1df7aa2b65c31ea16d5d14f1a1 Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Wed, 11 Aug 2021 14:03:47 -0700 Subject: [PATCH] Added PATH and LANG env variable to terminal, using parent, if defined. --- agents/meshcore.js | 5 ++++- agents/recoverycore.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/agents/meshcore.js b/agents/meshcore.js index afc00158..7a18bb05 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -1949,7 +1949,10 @@ function onTunnelData(data) { var login = process.platform == 'linux' ? '/bin/login' : '/usr/bin/login'; var env = { HISTCONTROL: 'ignoreboth' }; - if (this.httprequest.xoptions) { + if (process.env['LANG']) { env['LANG'] = process.env['LANG']; } + if (process.env['PATH']) { env['PATH'] = process.env['PATH']; } + if (this.httprequest.xoptions) + { if (this.httprequest.xoptions.rows) { env.LINES = ('' + this.httprequest.xoptions.rows); } if (this.httprequest.xoptions.cols) { env.COLUMNS = ('' + this.httprequest.xoptions.cols); } } diff --git a/agents/recoverycore.js b/agents/recoverycore.js index 5ca19756..d0d67dbb 100644 --- a/agents/recoverycore.js +++ b/agents/recoverycore.js @@ -979,7 +979,10 @@ require('MeshAgent').AddCommandHandler(function (data) { } else { var env = { HISTCONTROL: 'ignoreboth' }; - if (this.httprequest.xoptions) { + if (process.env['LANG']) { env['LANG'] = process.env['LANG']; } + if (process.env['PATH']) { env['PATH'] = process.env['PATH']; } + if (this.httprequest.xoptions) + { if (this.httprequest.xoptions.rows) { env.LINES = ('' + this.httprequest.xoptions.rows); } if (this.httprequest.xoptions.cols) { env.COLUMNS = ('' + this.httprequest.xoptions.cols); } }