mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8202105: Console echo is disabled when exiting jshell
Preserving original terminal echo state when Console.readPassword finishes. Reviewed-by: sherman, martin
This commit is contained in:
parent
b9490e5760
commit
f7afa8ff53
3 changed files with 31 additions and 55 deletions
|
@ -67,14 +67,3 @@ Java_java_io_Console_echo(JNIEnv *env,
|
|||
}
|
||||
return old;
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_java_io_Console_echo0(JNIEnv *env, jclass cls) {
|
||||
struct termios tio;
|
||||
int tty = fileno(stdin);
|
||||
if (tcgetattr(tty, &tio) == -1) {
|
||||
JNU_ThrowIOExceptionWithLastError(env, "tcgetattr failed");
|
||||
return JNI_TRUE;
|
||||
}
|
||||
return (tio.c_lflag & ECHO) != 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue