fix: cols and rows were not properly assigned for terminal (#337)

* fix: set correct vars and cols property

* fix: add cols and rows to session.ssh property

* style: remove const assignment

---------

Co-authored-by: w-v <wtv@protonmail.ch>
Co-authored-by: bc 064 <87337961+bcvort@users.noreply.github.com>
This commit is contained in:
Bill Church 2023-08-22 09:16:10 -04:00 committed by GitHub
parent acb4e42fde
commit 3246df75b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -102,7 +102,8 @@ const onConnection = (socket) => {
});
socket.on('geometry', (cols, rows) => {
// TODO need to rework how we pass settings to ssh2, this is less than ideal
socket.request.session.ssh.terminfo = { cols, rows };
socket.request.session.ssh.cols = cols;
socket.request.session.ssh.rows = rows;
webssh2debug(socket, `SOCKET GEOMETRY: termCols = ${cols}, termRows = ${rows}`);
});
};

View file

@ -171,6 +171,8 @@ exports.connect = function connect(req, res) {
letterSpacing,
lineHeight,
},
cols: null,
rows: null,
allowreplay:
config.options.challengeButton ||
(validator.isBoolean(`${req.headers.allowreplay}`)