From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:38638) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8Xls-0002D2-Nq for qemu-devel@nongnu.org; Tue, 27 Sep 2011 09:32:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R8Xln-0007GL-B5 for qemu-devel@nongnu.org; Tue, 27 Sep 2011 09:32:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21810) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8Xln-0007GB-1g for qemu-devel@nongnu.org; Tue, 27 Sep 2011 09:32:23 -0400 Message-ID: <4E81D04C.2020106@redhat.com> Date: Tue, 27 Sep 2011 15:31:56 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1317129247-16562-1-git-send-email-chouteau@adacore.com> In-Reply-To: <1317129247-16562-1-git-send-email-chouteau@adacore.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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: Fabien Chouteau Cc: qemu-devel@nongnu.org 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