diff --git a/nchan.c b/nchan.c index 804519e..8d9d132 100644 --- a/nchan.c +++ b/nchan.c @@ -187,8 +187,24 @@ chan_ibuf_empty(Channel *c) switch (c->istate) { case CHAN_INPUT_WAIT_DRAIN: if (compat20) { - if (!(c->flags & (CHAN_CLOSE_SENT|CHAN_LOCAL))) + if (!(c->flags & (CHAN_CLOSE_SENT | CHAN_LOCAL))) { + #ifdef WIN32_FIXME + // reset the other side if tty to be how it was before + if (c->isatty) { + char *inittermseq = + "\033[?7h" // end-of-line autowrap ON mode + "\033[20l"; // force NewLineMode off + + buffer_append(&c->input, inittermseq, strlen(inittermseq)); + int state = c->istate; + c->istate = CHAN_INPUT_WAIT_DRAIN; + channel_output_poll(); + packet_write_poll(); // packet_write_wait(); + c->istate = state; + } + #endif chan_send_eof2(c); + } chan_set_istate(c, CHAN_INPUT_CLOSED); } else { chan_send_ieof1(c); diff --git a/serverloop.c b/serverloop.c index b59fa1e..f5ee00f 100644 --- a/serverloop.c +++ b/serverloop.c @@ -880,13 +880,6 @@ 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)); - packet_write_poll(); - } session_close_by_pid(s->pid, status); if (s->pid)