sshd sets the client terminal mode to original after an interactive session ends

This is needed so that sftp running after a ssh session from a Linux
client does not see two lines for each line typed. CRLF is set by win32
sshd server but we have to set mode to the previous way in the client
when an interactive session has ended.
This commit is contained in:
quamrulmina 2015-11-06 14:55:53 -06:00
parent c051e06f50
commit 9f26b75d5d

View File

@ -880,6 +880,13 @@ collect_children(void)
process = s->pid;
// send the other side terminal to be how it was before if it was tty
if ( (!s -> is_subsystem) && (s ->ttyfd != -1)) {
char *inittermseq = "\033[20l\033[?7h\0" ; // no LFtoCRLF no AUTOWRAPON
Channel *c=channel_by_id ( s->chanid );
buffer_append(&c->input, inittermseq, strlen(inittermseq));
channel_output_poll();
}
session_close_by_pid(s->pid, status);
CloseHandle(process);