}
HANDLE outhandle;
+DWORD orig_console_mode;
+
+void begin_session(void) {
+ if (!cfg.ldisc_term)
+ SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), ENABLE_PROCESSED_INPUT);
+ else
+ SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), orig_console_mode);
+}
void term_out(void)
{
int reap;
DWORD ret;
-
reap = 0;
while (reap < inbuf_head) {
if (!WriteFile(outhandle, inbuf+reap, inbuf_head-reap, &ret, NULL))
netevent = CreateEvent(NULL, FALSE, FALSE, NULL);
stdinevent = CreateEvent(NULL, FALSE, FALSE, NULL);
- if (!cfg.ldisc_term)
- SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), ENABLE_PROCESSED_INPUT);
+ GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), &orig_console_mode);
+ SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), ENABLE_PROCESSED_INPUT);
outhandle = GetStdHandle(STD_OUTPUT_HANDLE);
/*
void connection_fatal(char *, ...);
void fatalbox (char *, ...);
void beep (int);
+void begin_session(void);
#define OPTIMISE_IS_SCROLL 1
/*
default: return "WSAAsyncSelect(): unknown error";
}
+ /*
+ * We have no pre-session phase.
+ */
+ begin_session();
+
return NULL;
}
static void gui_update_stats(char *name, unsigned long size, int percentage, time_t elapsed);
/*
- * This function is needed to link with ssh.c, but it never gets called.
+ * These functions are needed to link with ssh.c, but never get called.
*/
void term_out(void)
{
abort();
}
+void begin_session(void) {
+}
/* GUI Adaptation - Sept 2000 */
void send_msg(HWND h, UINT message, WPARAM wParam)
ssh_send_ok = 1;
ssh_channels = newtree234(ssh_channelcmp);
+ begin_session();
while (1) {
crReturnV;
if (ispkt) {
* Transfer data!
*/
ssh_send_ok = 1;
+ begin_session();
while (1) {
static int try_send;
crReturnV;
* Set up SYNCH state.
*/
in_synch = FALSE;
+
+ /*
+ * We have no pre-session phase.
+ */
+ begin_session();
+
return NULL;
}
static char *window_name, *icon_name;
+static Ldisc *real_ldisc;
+
+void begin_session(void) {
+ ldisc = real_ldisc;
+}
+
int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) {
static char appname[] = "PuTTY";
WORD winsock_ver;
}
}
- ldisc = (cfg.ldisc_term ? &ldisc_term : &ldisc_simple);
+ real_ldisc = (cfg.ldisc_term ? &ldisc_term : &ldisc_simple);
+ /* To start with, we use the simple line discipline, so we can
+ * type passwords etc without fear of them being echoed... */
+ ldisc = &ldisc_simple;
if (!prev) {
wndclass.style = 0;