Merge pull request #864 from JacobBarthelmeh/windows_sshd

pull/867/head
John Safranek 2026-01-09 17:18:10 -07:00 committed by GitHub
commit fa648eccd0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 4 deletions

View File

@ -1096,16 +1096,22 @@ static int WS_TermResize(WOLFSSH* ssh, word32 col, word32 row, word32 colP,
int ret = WS_SUCCESS;
if (term != NULL) {
char cmd[20];
int cmdSz = 20;
char cmd[30]; /* 2 int values (11 chars max) plus \x1b[8 ; t */
int cmdSz;
DWORD wrtn = 0;
cmdSz = (int)sizeof(cmd);
/* VT control sequence for resizing window */
cmdSz = snprintf(cmd, cmdSz, "\x1b[8;%d;%dt", row, col);
if (WriteFile(*term, cmd, cmdSz, &wrtn, 0) != TRUE) {
WLOG(WS_LOG_ERROR, "Issue with pseudo console resize");
if (cmdSz < 0 || cmdSz >= sizeof(cmd)) {
ret = WS_FATAL_ERROR;
}
else {
if (WriteFile(*term, cmd, cmdSz, &wrtn, 0) != TRUE) {
WLOG(WS_LOG_ERROR, "Issue with pseudo console resize");
ret = WS_FATAL_ERROR;
}
}
}
return ret;