@@ -605,6 +605,7 @@ do_exec_no_pty(Session *s, const char *command)
605
605
*/
606
606
607
607
HANDLE wfdtocmd = -1 ;
608
+ int retcode = -1 ;
608
609
if ( (!s -> is_subsystem ) && (s -> ttyfd != -1 ))
609
610
{
610
611
//FreeConsole();
@@ -622,8 +623,6 @@ do_exec_no_pty(Session *s, const char *command)
622
623
//if (sockin[1] >= 0)
623
624
// sfd_set_to_console(sockin[1]); // mark it as Console type
624
625
625
- //allocate_standard_descriptor(STDIN_FILENO);
626
- //allocate_standard_descriptor(wfdtocmd); // put the std input handle in our global general handle table
627
626
}
628
627
else
629
628
socketpair (sockin );
@@ -880,8 +879,9 @@ do_exec_no_pty(Session *s, const char *command)
880
879
881
880
if (!(s -> is_subsystem )) {
882
881
// 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
883
883
Channel * c = channel_by_id ( s -> chanid );
884
- buffer_append (& c -> input , "\033[20h" , 5 );
884
+ buffer_append (& c -> input , inittermseq , strlen ( inittermseq ) );
885
885
channel_output_poll ();
886
886
}
887
887
@@ -908,6 +908,7 @@ do_exec_no_pty(Session *s, const char *command)
908
908
MultiByteToWideChar (CP_UTF8 , 0 , exec_command , -1 , exec_command_w , MAX_PATH );
909
909
DWORD dwStartupFlags = CREATE_SUSPENDED ; // 0
910
910
911
+ SetConsoleCtrlHandler (NULL , FALSE);
911
912
b = CreateProcessAsUserW (hToken , NULL , exec_command_w , NULL , NULL , TRUE,
912
913
/*CREATE_NEW_PROCESS_GROUP*/ dwStartupFlags , NULL , s -> pw -> pw_dir ,
913
914
& si , & pi );
@@ -969,6 +970,7 @@ do_exec_no_pty(Session *s, const char *command)
969
970
close (sockerr [0 ]);
970
971
971
972
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);
972
974
973
975
/*
974
976
* 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)
2726
2728
pty_setowner (s -> pw , s -> tty );
2727
2729
2728
2730
/* Set window size from the packet. */
2731
+ #ifndef WIN32_FIXME
2729
2732
pty_change_window_size (s -> ptyfd , s -> row , s -> col , s -> xpixel , s -> ypixel );
2733
+ #endif
2730
2734
2731
2735
packet_check_eom ();
2732
2736
session_proctitle (s );
0 commit comments