mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2026-01-08 09:31:42 +01:00
8166535: jshell tool: cannot handle non-ascii characters
Using a more appropriate native method to read from the console. Reviewed-by: rfield
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -77,7 +77,7 @@ JNIEXPORT jobject JNICALL Java_jdk_internal_jline_WindowsTerminal_readKeyEvent
|
||||
INPUT_RECORD record;
|
||||
DWORD n;
|
||||
while (TRUE) {
|
||||
if (ReadConsoleInput(hStdIn, &record, 1, &n) == 0) {
|
||||
if (ReadConsoleInputW(hStdIn, &record, 1, &n) == 0) {
|
||||
return NULL;
|
||||
}
|
||||
if (record.EventType == KEY_EVENT) {
|
||||
@@ -97,7 +97,7 @@ JNIEXPORT jobject JNICALL Java_jdk_internal_jline_WindowsTerminal_readKeyEvent
|
||||
|
||||
JNIEXPORT jint JNICALL Java_jdk_internal_jline_WindowsTerminal_getConsoleOutputCodepage
|
||||
(JNIEnv *, jobject) {
|
||||
return GetConsoleCP();
|
||||
return GetConsoleOutputCP();
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_jdk_internal_jline_WindowsTerminal_getWindowsTerminalWidth
|
||||
|
||||
Reference in New Issue
Block a user