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

This commit is contained in:
TotallyNotElite 2020-02-05 21:56:42 +01:00
parent 6bf82c7cb3
commit 291c9c0af3
2 changed files with 5 additions and 5 deletions

View File

@ -73,7 +73,7 @@ var CreateAmtRemoteTerminal = function (divid, options) {
} }
obj.xxStateChange = function (newstate) { obj.xxStateChange = function (newstate) {
if ((newstate == 3) && (options != null) && (options.xterm == true)) { obj.TermSendKeys(' stty rows ' + obj.height + ' cols ' + obj.width + ';clear\n'); } //if ((newstate == 3) && (options != null) && (options.xterm == true)) { obj.TermSendKeys(' stty rows ' + obj.height + ' cols ' + obj.width + ';clear\n'); }
} }
obj.ProcessData = function (str) { obj.ProcessData = function (str) {
@ -805,6 +805,6 @@ var CreateAmtRemoteTerminal = function (divid, options) {
obj.heightLock = 0; obj.heightLock = 0;
obj.DivElement.style['height'] = ''; obj.DivElement.style['height'] = '';
if ((options != null) && (options.width != null) && (options.height != null)) { obj.Init(options.width, options.height); } else { obj.Init(); } if ((options != null) && (options.cols != null) && (options.rows != null)) { obj.Init(options.cols, options.rows); } else { obj.Init(); }
return obj; return obj;
} }

View File

@ -6350,11 +6350,11 @@
var termoptions = { protocol: ((options != null) && (typeof options.protocol == 'number'))?options.protocol:1 }; var termoptions = { protocol: ((options != null) && (typeof options.protocol == 'number'))?options.protocol:1 };
if (options && options.requireLogin) { termoptions.requireLogin = true; } if (options && options.requireLogin) { termoptions.requireLogin = true; }
if ([1, 2, 3, 4, 21, 22].indexOf(currentNode.agent.id) == -1) { if ([1, 2, 3, 4, 21, 22].indexOf(currentNode.agent.id) == -1) {
if (Q('termSizeList').value == 2) { termoptions.width = 100; termoptions.height = 30; termoptions.xterm = true; } if (Q('termSizeList').value == 2) { termoptions.cols = 100; termoptions.rows = 30; termoptions.xterm = true; }
if (Q('termSizeList').value == 3) { if (Q('termSizeList').value == 3) {
// TODO: Try to improve terminal auto-size. // TODO: Try to improve terminal auto-size.
termoptions.width = Math.floor((Q('column_l').clientWidth - 60) / 10); termoptions.cols = Math.floor((Q('column_l').clientWidth - 60) / 10);
termoptions.height = Math.floor((Q('column_l').clientHeight - 120) / 20); termoptions.rows = Math.floor((Q('column_l').clientHeight - 120) / 20);
termoptions.xterm = true; termoptions.xterm = true;
} }
} }