From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8YOT-0003YQ-5J for qemu-devel@nongnu.org; Tue, 27 Sep 2011 10:12:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R8YON-0006sF-JV for qemu-devel@nongnu.org; Tue, 27 Sep 2011 10:12:21 -0400 Received: from mel.act-europe.fr ([194.98.77.210]:34836) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8YON-0006rv-F1 for qemu-devel@nongnu.org; Tue, 27 Sep 2011 10:12:15 -0400 Message-ID: <4E81D9B3.8040209@adacore.com> Date: Tue, 27 Sep 2011 16:12:03 +0200 From: Fabien Chouteau MIME-Version: 1.0 References: <1317129247-16562-1-git-send-email-chouteau@adacore.com> <4E81D04C.2020106@redhat.com> In-Reply-To: <4E81D04C.2020106@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Add stdio char device on windows List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On 27/09/2011 15:31, Paolo Bonzini wrote: > 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? > It's just more convenient to have the same behavior on all hosts (i.e. no \r). >> +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. > OK thanks, I missed that... Regards, -- Fabien Chouteau