Added support for resizing Windows Terminal, if the agent supports it

Bryan Roe committed Jan 30, 2020 at 11:00 UTC f11beb67c029f64afbd4ee76c1250a815642ec55
1 file changed +2 -3
agents/meshcore.js
+2 -3
@@ -1201,7 +1201,6 @@ function createMeshCore(agent) {
1201 that.httprequest._dispatcher.ws = that;
1202 that.httprequest._dispatcher.on('connection', function (c)
1203 {
1204 - console.log('client connected');
1204 this.ws._term = c;
1205 c.pipe(this.ws, { dataTypeSkip: 1 });
1206 this.ws.pipe(c, { dataTypeSkip: 1 });
@@ -1831,9 +1830,9 @@ function createMeshCore(agent) {
1830 // Indicates a change in terminal size
1831 if (process.platform == 'win32')
1832 {
1834 - if (ws.httprequest._term == null) return;
1833 + if (ws.httprequest._dispatcher == null) return;
1834 //sendConsoleText('Win32-TermSize: ' + obj.cols + 'x' + obj.rows);
1836 - // TODO
1835 + if (ws.httprequest._dispatcher.invoke) { ws.httprequest._dispatcher.invoke('resizeTerminal', [obj.cols, obj.rows]); }
1836 } else
1837 {
1838 if (ws.httprequest.process == null || ws.httprequest.process.pty == 0) return;