@@ -605,6 +605,7 @@ do_exec_no_pty(Session *s, const char *command)
605605 */
606606
607607 HANDLE wfdtocmd = -1 ;
608+ int retcode = -1 ;
608609 if ( (!s -> is_subsystem ) && (s -> ttyfd != -1 ))
609610 {
610611 //FreeConsole();
@@ -622,8 +623,6 @@ do_exec_no_pty(Session *s, const char *command)
622623 //if (sockin[1] >= 0)
623624 // sfd_set_to_console(sockin[1]); // mark it as Console type
624625
625- //allocate_standard_descriptor(STDIN_FILENO);
626- //allocate_standard_descriptor(wfdtocmd); // put the std input handle in our global general handle table
627626 }
628627 else
629628 socketpair (sockin );
@@ -880,8 +879,9 @@ do_exec_no_pty(Session *s, const char *command)
880879
881880 if (!(s -> is_subsystem )) {
882881 // Send to the remote client ANSI/VT Sequence so that they send us CRLF in place of LF
882+ char * inittermseq = "\033[20h\033[?7h\0" ; // LFtoCRLF AUTOWRAPON
883883 Channel * c = channel_by_id ( s -> chanid );
884- buffer_append (& c -> input , "\033[20h" , 5 );
884+ buffer_append (& c -> input , inittermseq , strlen ( inittermseq ) );
885885 channel_output_poll ();
886886 }
887887
@@ -908,6 +908,7 @@ do_exec_no_pty(Session *s, const char *command)
908908 MultiByteToWideChar (CP_UTF8 , 0 , exec_command , -1 , exec_command_w , MAX_PATH );
909909 DWORD dwStartupFlags = CREATE_SUSPENDED ; // 0
910910
911+ SetConsoleCtrlHandler (NULL , FALSE);
911912 b = CreateProcessAsUserW (hToken , NULL , exec_command_w , NULL , NULL , TRUE,
912913 /*CREATE_NEW_PROCESS_GROUP*/ dwStartupFlags , NULL , s -> pw -> pw_dir ,
913914 & si , & pi );
@@ -969,6 +970,7 @@ do_exec_no_pty(Session *s, const char *command)
969970 close (sockerr [0 ]);
970971
971972 ResumeThread ( pi .hThread ); /* now let cmd shell main thread be active s we have closed all i/o file handle that cmd will use */
973+ SetConsoleCtrlHandler (NULL , TRUE);
972974
973975 /*
974976 * Close child thread handles as we do not need it. Process handle we keep so that we can know if it has died o not
@@ -2726,7 +2728,9 @@ session_pty_req(Session *s)
27262728 pty_setowner (s -> pw , s -> tty );
27272729
27282730 /* Set window size from the packet. */
2731+ #ifndef WIN32_FIXME
27292732 pty_change_window_size (s -> ptyfd , s -> row , s -> col , s -> xpixel , s -> ypixel );
2733+ #endif
27302734
27312735 packet_check_eom ();
27322736 session_proctitle (s );
0 commit comments