X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/c6ccd5c22a25aca610b0120b3eec1e6efd1aab97..8c1835c0f951be43da1fb19405c7ff958a9b8661:/windows/winplink.c diff --git a/windows/winplink.c b/windows/winplink.c index fdf01901..ae80bf9b 100644 --- a/windows/winplink.c +++ b/windows/winplink.c @@ -598,16 +598,16 @@ int main(int argc, char **argv) inhandle = GetStdHandle(STD_INPUT_HANDLE); outhandle = GetStdHandle(STD_OUTPUT_HANDLE); errhandle = GetStdHandle(STD_ERROR_HANDLE); - GetConsoleMode(inhandle, &orig_console_mode); - SetConsoleMode(inhandle, ENABLE_PROCESSED_INPUT); - - main_thread_id = GetCurrentThreadId(); - /* * Turn off ECHO and LINE input modes. We don't care if this * call fails, because we know we aren't necessarily running in * a console. */ + GetConsoleMode(inhandle, &orig_console_mode); + SetConsoleMode(inhandle, ENABLE_PROCESSED_INPUT); + + main_thread_id = GetCurrentThreadId(); + handles[0] = netevent; handles[1] = stdinevent; handles[2] = stdoutevent;