Skip to content
Snippets Groups Projects
Commit 1e0c5446 authored by Zhang Huasen's avatar Zhang Huasen Committed by Marc-André Lureau
Browse files

chardev/char-win-stdio: Support VT sequences on Windows 11 host

If the monitor or the serial port use STDIO as backend on Windows 11 host,
e.g. -nographic options is used, the monitor or the guest Linux do not
response to arrow keys.

When Windows creates a console, ENABLE_VIRTUAL_PROCESS_INPUT is disabled
by default. Arrow keys cannot be retrieved by ReadFile or ReadConsoleInput
functions.

Add ENABLE_VIRTUAL_PROCESS_INPUT to the flag which is passed to SetConsoleMode,
when opening stdio console.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1674



Signed-off-by: default avatarZhang Huasen <huasenzhang@foxmail.com>
Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <tencent_8DA57B405D427A560FD40F8FB0C0B1ADDE09@qq.com>
parent b097b80b
No related branches found
No related tags found
No related merge requests found
......@@ -190,7 +190,7 @@ static void qemu_chr_open_stdio(Chardev *chr,
}
}
dwMode |= ENABLE_LINE_INPUT;
dwMode |= ENABLE_LINE_INPUT | ENABLE_VIRTUAL_TERMINAL_INPUT;
if (is_console) {
/* set the terminal in raw mode */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment