diff --git a/channels.c b/channels.c index 11c71a2..61bc0ea 100644 --- a/channels.c +++ b/channels.c @@ -2395,8 +2395,9 @@ channel_output_poll(void) } } } - - +#ifdef WIN32_FIXME +int lftocrlf = 0; +#endif /* -- protocol input */ /* ARGSUSED */ @@ -2452,6 +2453,17 @@ channel_input_data(int type, u_int32_t seq, void *ctxt) } c->local_window -= win_len; } + + #ifdef WIN32_FIXME + if ( (c->client_tty) && (data_len >= 5) ) { + if ( data[0] == '\033' ) { // escape char octal 33, decimal 27 + if ( (data[1] == '[') && (data[2]== '2') && (data[3]== '0') && ( data[4]== 'h' )) { + lftocrlf = 1; + } + } + } + #endif + if (c->datagram) buffer_put_string(&c->output, data, data_len); else diff --git a/clientloop.c b/clientloop.c index 3d66b9b..6a52f8e 100644 --- a/clientloop.c +++ b/clientloop.c @@ -1320,6 +1320,14 @@ process_escapes(Channel *c, Buffer *bin, Buffer *bout, Buffer *berr, * and append it to the buffer. */ last_was_cr = (ch == '\r' || ch == '\n'); + #ifdef WIN32_FIXME + extern int lftocrlf ; // defined in channels.c file's channel_input_data() function for now + if ( (lftocrlf == 1) && ( ch == '\n') ) { + // add a \r before \n if sshd server sent us ESC[20h during initial tty mode setting + buffer_put_char(bin, '\r'); + bytes++; + } + #endif buffer_put_char(bin, ch); bytes++; } diff --git a/version.h b/version.h index 04a4990..f6d3d7b 100644 --- a/version.h +++ b/version.h @@ -2,5 +2,5 @@ #define SSH_VERSION "OpenSSH_7.1" -#define SSH_PORTABLE "p1 Microsoft Pragma Win32 port Sep 30 2015" +#define SSH_PORTABLE "p1 Microsoft Pragma Win32 port Oct 7 2015" #define SSH_RELEASE SSH_VERSION SSH_PORTABLE