Rename width and height to cols and rows to fix size issue with non xterm terminal

TotallyNotElite committed Feb 5, 2020 at 21:56 UTC c71c043b013f626831fda15ff3660aaecf7d6fd9
2 files changed +5 -5
public/scripts/amt-terminal-0.0.2.js
+2 -2
@@ -73,7 +73,7 @@ var CreateAmtRemoteTerminal = function (divid, options) {
73 }
74
75 obj.xxStateChange = function (newstate) {
76 - if ((newstate == 3) && (options != null) && (options.xterm == true)) { obj.TermSendKeys(' stty rows ' + obj.height + ' cols ' + obj.width + ';clear\n'); }
76 + //if ((newstate == 3) && (options != null) && (options.xterm == true)) { obj.TermSendKeys(' stty rows ' + obj.height + ' cols ' + obj.width + ';clear\n'); }
77 }
78
79 obj.ProcessData = function (str) {
@@ -805,6 +805,6 @@ var CreateAmtRemoteTerminal = function (divid, options) {
805
806 obj.heightLock = 0;
807 obj.DivElement.style['height'] = '';
808 - if ((options != null) && (options.width != null) && (options.height != null)) { obj.Init(options.width, options.height); } else { obj.Init(); }
808 + if ((options != null) && (options.cols != null) && (options.rows != null)) { obj.Init(options.cols, options.rows); } else { obj.Init(); }
809 return obj;
810 }
views/default.handlebars
+3 -3
@@ -6350,11 +6350,11 @@
6350 var termoptions = { protocol: ((options != null) && (typeof options.protocol == 'number'))?options.protocol:1 };
6351 if (options && options.requireLogin) { termoptions.requireLogin = true; }
6352 if ([1, 2, 3, 4, 21, 22].indexOf(currentNode.agent.id) == -1) {
6353 - if (Q('termSizeList').value == 2) { termoptions.width = 100; termoptions.height = 30; termoptions.xterm = true; }
6353 + if (Q('termSizeList').value == 2) { termoptions.cols = 100; termoptions.rows = 30; termoptions.xterm = true; }
6354 if (Q('termSizeList').value == 3) {
6355 // TODO: Try to improve terminal auto-size.
6356 - termoptions.width = Math.floor((Q('column_l').clientWidth - 60) / 10);
6357 - termoptions.height = Math.floor((Q('column_l').clientHeight - 120) / 20);
6356 + termoptions.cols = Math.floor((Q('column_l').clientWidth - 60) / 10);
6357 + termoptions.rows = Math.floor((Q('column_l').clientHeight - 120) / 20);
6358 termoptions.xterm = true;
6359 }
6360 }