Skip to content

Commit 7aac59e

Browse files
committed
Add ANSI parsing engine and console draw support to ssh client
Makes the ssh.exe client more useable in interactive mode with ANSI color and a console screen support.
1 parent a55816f commit 7aac59e

File tree

10 files changed

+3108
-14
lines changed

10 files changed

+3108
-14
lines changed

channels.c

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2454,25 +2454,16 @@ channel_input_data(int type, u_int32_t seq, void *ctxt)
24542454
c->local_window -= win_len;
24552455
}
24562456

2457-
#ifdef WIN32_FIXME
2458-
if ( (c->client_tty) && (data_len >= 5) ) {
2459-
if ( data[0] == '\033' ) { // escape char octal 33, decimal 27
2460-
if ( (data[1] == '[') && (data[2]== '2') && (data[3]== '0') && ( data[4]== 'h' )) {
2461-
lftocrlf = 1;
2462-
data = data + 5 ; // we have processed the 5 bytes ESC sequence
2463-
data_len = data_len - 5;
2464-
}
2465-
}
2466-
}
2467-
#endif
2468-
24692457
if (c->datagram)
24702458
buffer_put_string(&c->output, data, data_len);
24712459
else {
24722460
#ifndef WIN32_FIXME
24732461
buffer_append(&c->output, data, data_len);
24742462
#else
2475-
buffer_append(&c->output, data, data_len);
2463+
if ( c->client_tty )
2464+
telProcessNetwork ( data, data_len ); // run it by ANSI engine if it is the ssh client
2465+
else
2466+
buffer_append(&c->output, data, data_len); // it is the sshd server, so pass it on
24762467
if ( c->isatty ) {
24772468
buffer_append(&c->input, data, data_len); // we echo the data if it is sshd server and pty interactive mode
24782469
if ( (data_len ==1) && (data[0] == '\b') )

contrib/win32/win32compat/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ LDFLAGS=-L. @LDFLAGS@
1818

1919
WIN32COMPATFILES = daemon.o gettimeofday.o homedirhelp.o pwd.o sfds.o \
2020
socket.o startupneeds.o strcasecmp.o syslog.o lsalogon.o lsastring.o \
21-
stringhelp.o deskright.o win32auth.o kerberos.o
21+
stringhelp.o deskright.o win32auth.o kerberos.o ansiprsr.o console.o tnnet.o
2222

2323
WIN32COMPATLIB=@LIBWIN32COMPAT@
2424

0 commit comments

Comments
 (0)