--- ../nethack/nethack-3.4.3/win/tty/wintty.c 2003-12-08 00:39:14.000000000 +0100 +++ win/tty/wintty.c 2009-08-13 16:29:07.000000000 +0200 @@ -2510,6 +2510,7 @@ tty_nhgetch() { int i; + static int esc = 0; #ifdef UNIX /* kludge alert: Some Unix variants return funny values if getc() * is called, interrupted, and then called again. There @@ -2536,6 +2537,11 @@ #else i = tgetch(); #endif + if (esc) { + i |= 0x80; + esc = 0; + } else if (i == '\033') + esc = 1; if (!i) i = '\033'; /* map NUL to ESC since nethack doesn't expect NUL */ if (ttyDisplay && ttyDisplay->toplin == 1) ttyDisplay->toplin = 2;