Skip to content

Commit ef44b38

Browse files
Merge pull request #868 from ejohnstown/fix-test-term-size
Fix Test Term Size
2 parents fa648ec + 78e3899 commit ef44b38

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

examples/echoserver/echoserver.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -862,24 +862,24 @@ static int ssh_worker(thread_ctx_t* threadCtx)
862862
ChildRunning = 1;
863863
#endif
864864

865-
#if defined(WOLFSSH_TERM) && defined(WOLFSSH_SHELL)
866-
/* set initial size of terminal based on saved size */
865+
#if !defined(NO_TERMIOS) && defined(WOLFSSH_TERM) && defined(WOLFSSH_SHELL)
867866
#if defined(HAVE_SYS_IOCTL_H)
868-
wolfSSH_DoModes(ssh->modes, ssh->modesSz, childFd);
869-
{
867+
/* if not echoing, set initial size of terminal based on saved size */
868+
if (!threadCtx->echo) {
870869
struct winsize s = {0,0,0,0};
871870

871+
wolfSSH_DoModes(ssh->modes, ssh->modesSz, childFd);
872872
s.ws_col = ssh->widthChar;
873873
s.ws_row = ssh->heightRows;
874874
s.ws_xpixel = ssh->widthPixels;
875875
s.ws_ypixel = ssh->heightPixels;
876876

877877
ioctl(childFd, TIOCSWINSZ, &s);
878-
}
879-
#endif /* HAVE_SYS_IOCTL_H */
880878

881879
wolfSSH_SetTerminalResizeCtx(ssh, (void*)&childFd);
882-
#endif /* WOLFSSH_TERM && WOLFSSH_SHELL */
880+
}
881+
#endif /* HAVE_SYS_IOCTL_H */
882+
#endif /* !NO_TERMIOS && WOLFSSH_TERM && WOLFSSH_SHELL */
883883

884884
while (ChildRunning) {
885885
fd_set readFds;

0 commit comments

Comments
 (0)