mirror of https://github.com/wolfSSL/wolfssh.git
commit
5af49f2f9e
|
@ -52,7 +52,7 @@ AC_CHECK_SIZEOF([long])
|
|||
AC_CHECK_SIZEOF([off_t])
|
||||
|
||||
# Check headers/libs
|
||||
AC_CHECK_HEADERS([sys/select.h sys/time.h pty.h util.h termios.h])
|
||||
AC_CHECK_HEADERS([sys/select.h sys/time.h sys/ioctl.h pty.h util.h termios.h])
|
||||
AC_CHECK_LIB([network],[socket])
|
||||
AC_CHECK_LIB([util],[forkpty])
|
||||
|
||||
|
|
|
@ -13069,20 +13069,21 @@ int SendChannelTerminalResize(WOLFSSH* ssh, word32 columns, word32 rows,
|
|||
}
|
||||
|
||||
|
||||
#ifdef __linux__
|
||||
#ifdef HAVE_PTY_H
|
||||
#include <pty.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
static void GetTerminalSize(word32* width, word32* height)
|
||||
static void GetTerminalSize(word32* width, word32* height,
|
||||
word32* pixWidth, word32* pixHeight)
|
||||
{
|
||||
#ifdef __linux__
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
struct winsize windowSize = { 0,0,0,0 };
|
||||
|
||||
ioctl(STDOUT_FILENO, TIOCGWINSZ, &windowSize);
|
||||
*width = (word32)windowSize.ws_col;
|
||||
*height = (word32)windowSize.ws_row;
|
||||
*pixWidth = (word32)windowSize.ws_xpixel;
|
||||
*pixHeight = (word32)windowSize.ws_ypixel;
|
||||
#elif defined(_MSC_VER)
|
||||
CONSOLE_SCREEN_BUFFER_INFO cs;
|
||||
|
||||
|
@ -13110,15 +13111,14 @@ int SendChannelTerminalRequest(WOLFSSH* ssh)
|
|||
const char envVar[] = "xterm";
|
||||
byte mode[4096];
|
||||
word32 envSz, typeSz, modeSz;
|
||||
word32 w, h;
|
||||
word32 pxW = 0, pxH = 0;
|
||||
word32 w = 0, h = 0, pxW = 0, pxH = 0;
|
||||
|
||||
WLOG(WS_LOG_DEBUG, "Entering SendChannelTerminalRequest()");
|
||||
|
||||
if (ssh == NULL)
|
||||
ret = WS_BAD_ARGUMENT;
|
||||
|
||||
GetTerminalSize(&w, &h);
|
||||
GetTerminalSize(&w, &h, &pxW, &pxH);
|
||||
envSz = (word32)WSTRLEN(envVar);
|
||||
typeSz = (word32)WSTRLEN(cType);
|
||||
modeSz = CreateMode(ssh, mode);
|
||||
|
|
Loading…
Reference in New Issue