<html><body><div><span style="font-family: Aptos, Aptos_MSFontService, -apple-system, Roboto, Arial, Helvetica, sans-serif; font-size: 12pt;"></span>I know my View of console is always a bit controverdial, but having access to /dev/tty despite a program have redirected stdout and stderr would be a feature, not something you actively need to disable.</div><div>But I guess writing system tools it not something Java ever was made for :)  </div><div id="ms-outlook-mobile-body-separator-line" dir="ltr"><br></div><div id="ms-outlook-mobile-signature"><span style="font-family: Aptos; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">Gruß,</span><div dir="ltr" style="text-align: left; text-indent: 0px; background-color: rgb(255, 255, 255); font-family: Aptos; font-size: 12pt; color: rgb(0, 0, 0);">Bernd</div><div dir="ltr" style="text-align: left; text-indent: 0px; background-color: rgb(255, 255, 255); font-family: Aptos; font-size: 12pt; color: rgb(0, 0, 0);">-- </div><div style="font-family: Aptos; font-size: 12pt; color: rgb(0, 0, 0);"><span style="background-color: rgb(255, 255, 255);">https://bernd.eckenfels.net</span></div></div><div id="mail-editor-reference-message-container" class="ms-outlook-mobile-reference-message"><hr style="display: inline-block; width: 98%;"><div id="divRplyFwdMsg" dir="ltr"><span style="font-family: Calibri, sans-serif;"><b>Von:</b> core-libs-dev <core-libs-dev-retn@openjdk.org> im Auftrag von Alan Bateman <alanb@openjdk.org><br><b>Gesendet:</b> Donnerstag, August 21, 2025 7:50 AM<br><b>An:</b> compiler-dev@openjdk.org <compiler-dev@openjdk.org>; core-libs-dev@openjdk.org <core-libs-dev@openjdk.org><br><b>Betreff:</b> Re: RFR: 8361613: System.console() should only be available for interactive terminal [v3]</span><div style="font-family: Calibri, sans-serif;"> </div></div>On Mon, 14 Jul 2025 20:23:25 GMT, Naoto Sato <naoto@openjdk.org> wrote:
<br>
<br>>> In prior JDK releases, `System.console()` could return a `Console` instance even when the JVM was not attached to an interactive terminal. This could lead to confusion, particularly when input was not from a keyboard or output was redirected, such as to or from a file or pipe, especially when using methods like `readPassword()`. Starting with JDK 25, the default behavior has changed: `System.console()` now returns `null` if standard input and/or output is redirected. However, if a JLine-based Console implementation is explicitly specified via the system property `-Djdk.console=jdk.internal.le`, the previous behavior may still occur.
<br>>> This PR aims to align the behavior of the JLine-based `Console` implementation with the default `System.console()` behavior. The actual code change is a one-liner in `JdkConsoleProviderImpl.java`; the rest of the changes are adjustments to test cases to reflect the updated behavior. A corresponding CSR has also been drafted.
<br>>
<br>> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision:
<br>> 
<br>>   Reflects review comments
<br>
<br>Marked as reviewed by alanb (Reviewer).
<br>
<br>-------------
<br>
<br>PR Review: https://git.openjdk.org/jdk/pull/26273#pullrequestreview-3139104718
<br>
<br></div></body></html>