mirror of
https://github.com/PowerShell/Win32-OpenSSH.git
synced 2025-07-22 21:45:09 +02:00
sshd pty console screen size set to what ssh client requests
Initial remote console screen size set correctly in sshd interactive session to the value we received from the ssh client in the pty-req request.
This commit is contained in:
parent
b56534c4a6
commit
1178689011
@ -610,8 +610,14 @@ do_exec_no_pty(Session *s, const char *command)
|
|||||||
//FreeConsole();
|
//FreeConsole();
|
||||||
//AllocConsole();
|
//AllocConsole();
|
||||||
MakeNewConsole();
|
MakeNewConsole();
|
||||||
|
prot_scr_width = s->col;
|
||||||
|
prot_scr_height = s->row;
|
||||||
|
extern HANDLE hConsole ;
|
||||||
|
hConsole = GetStdHandle (STD_OUTPUT_HANDLE);
|
||||||
|
ConSetScreenSize( s->col, s->row );
|
||||||
|
s->ptyfd = hConsole ; // the pty is the Windows console output handle in our Win32 port
|
||||||
|
|
||||||
wfdtocmd = GetStdHandle (STD_INPUT_HANDLE) ;
|
wfdtocmd = GetStdHandle (STD_INPUT_HANDLE) ; // we use this console handle to feed input to Windows shell cmd.exe
|
||||||
sockin[1] = allocate_sfd((int)wfdtocmd); // put the std input handle in our global general handle table
|
sockin[1] = allocate_sfd((int)wfdtocmd); // put the std input handle in our global general handle table
|
||||||
//if (sockin[1] >= 0)
|
//if (sockin[1] >= 0)
|
||||||
// sfd_set_to_console(sockin[1]); // mark it as Console type
|
// sfd_set_to_console(sockin[1]); // mark it as Console type
|
||||||
|
4
sshpty.c
4
sshpty.c
@ -211,6 +211,10 @@ pty_change_window_size(int ptyfd, u_int row, u_int col,
|
|||||||
w.ws_xpixel = xpixel;
|
w.ws_xpixel = xpixel;
|
||||||
w.ws_ypixel = ypixel;
|
w.ws_ypixel = ypixel;
|
||||||
(void) ioctl(ptyfd, TIOCSWINSZ, &w);
|
(void) ioctl(ptyfd, TIOCSWINSZ, &w);
|
||||||
|
#else
|
||||||
|
extern HANDLE hConsole ;
|
||||||
|
hConsole = ptyfd;
|
||||||
|
ConSetScreenSize( col, row );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user