|
From: | Paolo Bonzini |
Subject: | Re: [Qemu-devel] [PATCH] Add stdio char device on windows |
Date: | Tue, 27 Sep 2011 15:31:56 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2 |
On 09/27/2011 03:14 PM, Fabien Chouteau wrote:
+ /* Some terminal emulator returns \r\n for Enter, just pass \n */ + if (win_stdio_buf == '\r') { + continue; + }
Does the \r actually do any damage?
+static void qemu_chr_set_echo_win_stdio(CharDriverState *chr, bool echo) +{ + DWORD mode = 0; + + GetConsoleMode(hStdIn, &mode); + + if (echo) { + SetConsoleMode(hStdIn, mode | (ENABLE_ECHO_INPUT)); + } else { + SetConsoleMode(hStdIn, mode & (~ENABLE_ECHO_INPUT)); + } +}
You also need to enable ENABLE_LINE_INPUT for ENABLE_ECHO_INPUT to have effect.
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |