mirror of
https://github.com/PowerShell/Win32-OpenSSH.git
synced 2025-07-23 05:55:41 +02:00
add pty support to ssh client
pty and tty support was not enabled or working in the code. Without pty support, ssh client was very non functional - e.g. openssh linux server prompt would not come through. Now ssh client works much better in interactive mode ( uses pty).
This commit is contained in:
parent
989b8a9f01
commit
ac89e98293
@ -2563,6 +2563,7 @@ client_session2_setup(int id, int want_tty, int want_subsystem,
|
||||
tty_make_modes(-1, tiop);
|
||||
|
||||
#else
|
||||
packet_put_cstring(term != NULL ? term : "");
|
||||
packet_put_int((u_int) 80 /*ws.ws_col*/);
|
||||
packet_put_int((u_int) 25 /*ws.ws_row*/);
|
||||
packet_put_int((u_int) 640 /*ws.ws_xpixel*/);
|
||||
|
@ -264,6 +264,12 @@ int sfd_to_fd(int sfd)
|
||||
return sfd_map[sfd].fd;
|
||||
}
|
||||
|
||||
// set the sfd type to console. GetFileType() in Windows seem to return wrong type for a console returning PIPE (3) in place of CHARTYPE (2)
|
||||
void sfd_set_to_console(int sfd)
|
||||
{
|
||||
sfd_map[sfd].type = SFD_TYPE_CONSOLE;
|
||||
}
|
||||
|
||||
/*
|
||||
* For an sfd, get the real handle behind it
|
||||
*/
|
||||
|
@ -227,11 +227,11 @@ int WSHELPisatty(int sfd)
|
||||
* We can only do this for console fds.
|
||||
*/
|
||||
|
||||
if (sfd_is_console(sfd) && sfd > 0)
|
||||
if (sfd_is_console(sfd) && sfd >= 0)
|
||||
{
|
||||
ret = _isatty(sfd_to_fd(sfd));
|
||||
//ret = _isatty(sfd_to_fd(sfd));
|
||||
|
||||
return ret;
|
||||
return 1 ; //ret;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2825,7 +2825,11 @@ void allocate_standard_descriptor(int fd)
|
||||
{
|
||||
DBG_MSG("-> allocate_standard_descriptor(fd = %d)...\n", fd);
|
||||
|
||||
allocate_sfd(fd);
|
||||
int asfd = allocate_sfd(fd);
|
||||
|
||||
void sfd_set_to_console(int sfd);
|
||||
if (asfd >= 0)
|
||||
sfd_set_to_console(asfd);
|
||||
|
||||
DBG_MSG("<- allocate_standard_descriptor()...");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user