Fixed terminal windows popup in Win7.
Ylian Saint-Hilaire committed
Dec 20, 2018 at 15:44 UTC
bd5d52ccc7e3fd2783819f7305f2618c4f2b1da4
2 files changed
+7
-3
agents/modules_meshcore/win-terminal.js
+6
-2
@@ -156,6 +156,10 @@ function windows_terminal() {
156
if (this._kernel32.SetConsoleScreenBufferSize(this._stdoutput, coordScreen.Deref(0, 4).toBuffer().readUInt32LE()).Val == 0) {
157
throw ('Failed to set Console Buffer Size');
158
}
159
+
160
+ // Hide the console window
161
+ this._user32.ShowWindow(this._kernel32.GetConsoleWindow().Val, SW_HIDE);
162
+
163
this.ClearScreen();
164
this._hookThread().then(function () {
165
// Hook Ready
@@ -203,7 +207,7 @@ function windows_terminal() {
207
};
208
this._stop = function () {
209
if (this.stopping) { return (this.stopping); }
206
- console.log('Stopping Terminal...');
210
+ //console.log('Stopping Terminal...');
211
this.stopping = new promise(function (res, rej) { this._res = res; this._rej = rej; });
212
213
var threadID = this._kernel32.GetThreadId(this._user32.SetWinEventHook.async.thread()).Val;
@@ -458,7 +462,7 @@ function windows_terminal() {
462
function LOWORD(val) { return (val & 0xFFFF); }
463
function HIWORD(val) { return ((val >> 16) & 0xFFFF); }
464
function GetEsc(op, args) { return (Buffer.from('\x1B[' + args.join(';') + op)); }
461
-//function MeshConsole(msg) { require('MeshAgent').SendCommand({ "action": "msg", "type": "console", "value": JSON.stringify(msg) }); }
465
+function MeshConsole(msg) { require('MeshAgent').SendCommand({ "action": "msg", "type": "console", "value": JSON.stringify(msg) }); }
466
function TranslateLine(x, y, data, attributes) {
467
var i, fcolor, bcolor, rcolor, fbright, bbright, lastAttr, fc, bc, rc, fb, bb, esc = [], output = [GetEsc('H', [y, x])];
468
if (typeof attributes == 'number') { attributes = [ attributes ]; } // If we get a single attribute, turn it into an array.
package.json
+1
-1
@@ -1,6 +1,6 @@
1
{
2
"name": "meshcentral",
3
- "version": "0.2.4-z",
3
+ "version": "0.2.5-a",
4
"keywords": [
5
"Remote Management",
6
"Intel AMT",