Index: cmdinput.c =================================================================== --- cmdinput.c (revision 52055) +++ cmdinput.c (working copy) @@ -161,10 +161,25 @@ if (!ReadFile(hStdin, &chr, 1, &dwRead, NULL) || !dwRead) return FALSE; #ifdef _UNICODE - MultiByteToWideChar(InputCodePage, 0, &chr, 1, &str[charcount++], 1); + MultiByteToWideChar(InputCodePage, 0, &chr, 1, &str[charcount], 1); + chr=str[charcount]; #endif + if (chr==8 || chr==127) { + if (charcount>0) { + charcount--; + } else { + str[0]=_T('\0'); + ConOutPrintf (_T("\r")); /* go to beginning of line and reprint prompt */ + PrintPrompt (); + } + } else if (chr!='\n'){ + str[charcount++]=chr; + } } while (chr != '\n' && charcount < maxlen); str[charcount] = _T('\0'); + ConOutPrintf (_T("\r")); /* go to beginning of line and reprint prompt and input */ + PrintPrompt (); + ConOutPrintf (_T("%s\r\n"), str); return TRUE; }