Re: RFR: 8295803: Console should be usable in jshell and other environments [v7]

2022-12-08 Thread Naoto Sato
On Tue, 6 Dec 2022 18:10:38 GMT, Naoto Sato wrote: >> src/java.base/share/classes/java/io/Console.java line 99: >> >>> 97: */ >>> 98: >>> 99: public class Console implements Flushable >> >> Should we perhaps `seal` this class and only `permit` `ProxyingConsole` to >> `extend` it? > > Right.

Re: RFR: 8295803: Console should be usable in jshell and other environments [v13]

2022-12-07 Thread Alan Bateman
On Wed, 7 Dec 2022 19:19:25 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inter

Re: RFR: 8295803: Console should be usable in jshell and other environments [v12]

2022-12-07 Thread Naoto Sato
On Wed, 7 Dec 2022 18:57:19 GMT, Alan Bateman wrote: >> Naoto Sato has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Addressing review comments > > src/java.base/share/classes/java/io/ProxyingConsole.java line 167: > >> 165: @Over

Re: RFR: 8295803: Console should be usable in jshell and other environments [v13]

2022-12-07 Thread Naoto Sato
> This is to allow Console to be used even when it is not attached to the > platform provided terminal, such as the case when the standard input is > redirected. `System.console()` now returns a Console implementation based on > `jdk.internal.le` terminal by default, or jshell implementation if

Re: RFR: 8295803: Console should be usable in jshell and other environments [v12]

2022-12-07 Thread Alan Bateman
On Wed, 7 Dec 2022 17:09:53 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inter

Re: RFR: 8295803: Console should be usable in jshell and other environments [v11]

2022-12-07 Thread Naoto Sato
On Wed, 7 Dec 2022 11:54:11 GMT, Alan Bateman wrote: >> Naoto Sato has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Making the wrapper classes static > > src/java.base/share/classes/java/io/Console.java line 625: > >> 623: };

Re: RFR: 8295803: Console should be usable in jshell and other environments [v12]

2022-12-07 Thread Naoto Sato
> This is to allow Console to be used even when it is not attached to the > platform provided terminal, such as the case when the standard input is > redirected. `System.console()` now returns a Console implementation based on > `jdk.internal.le` terminal by default, or jshell implementation if

Re: RFR: 8295803: Console should be usable in jshell and other environments [v11]

2022-12-07 Thread Alan Bateman
On Tue, 6 Dec 2022 22:45:52 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inter

Re: RFR: 8295803: Console should be usable in jshell and other environments [v11]

2022-12-06 Thread Alan Bateman
On Tue, 6 Dec 2022 22:45:52 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inter

Re: RFR: 8295803: Console should be usable in jshell and other environments [v11]

2022-12-06 Thread Alan Bateman
On Tue, 6 Dec 2022 22:45:52 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inter

Re: RFR: 8295803: Console should be usable in jshell and other environments [v11]

2022-12-06 Thread Naoto Sato
> This is to allow Console to be used even when it is not attached to the > platform provided terminal, such as the case when the standard input is > redirected. `System.console()` now returns a Console implementation based on > `jdk.internal.le` terminal by default, or jshell implementation if

Re: RFR: 8295803: Console should be usable in jshell and other environments [v10]

2022-12-06 Thread Naoto Sato
> This is to allow Console to be used even when it is not attached to the > platform provided terminal, such as the case when the standard input is > redirected. `System.console()` now returns a Console implementation based on > `jdk.internal.le` terminal by default, or jshell implementation if

Re: RFR: 8295803: Console should be usable in jshell and other environments [v9]

2022-12-06 Thread Naoto Sato
On Tue, 6 Dec 2022 19:17:44 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inter

Re: RFR: 8295803: Console should be usable in jshell and other environments [v9]

2022-12-06 Thread Naoto Sato
> This is to allow Console to be used even when it is not attached to the > platform provided terminal, such as the case when the standard input is > redirected. `System.console()` now returns a Console implementation based on > `jdk.internal.le` terminal by default, or jshell implementation if

Re: RFR: 8295803: Console should be usable in jshell and other environments [v7]

2022-12-06 Thread Naoto Sato
On Tue, 6 Dec 2022 07:34:45 GMT, Alan Bateman wrote: >> src/java.base/share/classes/java/io/Console.java line 616: >> >>> 614: >>> JdkConsoleProvider.DEFAULT_PROVIDER_MODULE_NAME); >>> 615: return >>> ServiceLoader.load(JdkConsoleProvider.class).stream()

Re: RFR: 8295803: Console should be usable in jshell and other environments [v7]

2022-12-06 Thread Naoto Sato
On Tue, 6 Dec 2022 06:19:37 GMT, Jaikiran Pai wrote: >> Naoto Sato has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fixed the copyright year > > src/java.base/share/classes/java/io/Console.java line 99: > >> 97: */ >> 98: >> 99: public

Re: RFR: 8295803: Console should be usable in jshell and other environments [v8]

2022-12-06 Thread Naoto Sato
> This is to allow Console to be used even when it is not attached to the > platform provided terminal, such as the case when the standard input is > redirected. `System.console()` now returns a Console implementation based on > `jdk.internal.le` terminal by default, or jshell implementation if

Re: RFR: 8295803: Console should be usable in jshell and other environments [v7]

2022-12-06 Thread Alan Bateman
On Tue, 6 Dec 2022 07:35:44 GMT, Jaikiran Pai wrote: > So the `Console` instance returned from `System.console()`, thus far, follows > these semantics. However, with the change proposed in this PR, the default > implementation will now be the jline backed `JdkConsoleImpl` implementation. > Fro

Re: RFR: 8295803: Console should be usable in jshell and other environments [v7]

2022-12-05 Thread Alan Bateman
On Tue, 6 Dec 2022 07:08:55 GMT, Jaikiran Pai wrote: > Furthermore, I think in its current form it means that this will > load/instantiate any `JdkConsoleProvider` implementations that are accessible > to the thread context classloader but may not have been from the module > configured through

Re: RFR: 8295803: Console should be usable in jshell and other environments [v7]

2022-12-05 Thread Jaikiran Pai
On Mon, 5 Dec 2022 19:52:59 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inter

Re: RFR: 8295803: Console should be usable in jshell and other environments [v7]

2022-12-05 Thread Jaikiran Pai
On Mon, 5 Dec 2022 19:52:59 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inter

Re: RFR: 8295803: Console should be usable in jshell and other environments [v7]

2022-12-05 Thread Jaikiran Pai
On Mon, 5 Dec 2022 19:52:59 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inter

Re: RFR: 8295803: Console should be usable in jshell and other environments [v7]

2022-12-05 Thread Jaikiran Pai
On Mon, 5 Dec 2022 19:52:59 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inter

Re: RFR: 8295803: Console should be usable in jshell and other environments [v7]

2022-12-05 Thread Jaikiran Pai
On Mon, 5 Dec 2022 19:52:59 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inter

Re: RFR: 8295803: Console should be usable in jshell and other environments [v7]

2022-12-05 Thread Jaikiran Pai
On Mon, 5 Dec 2022 19:52:59 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inter

Re: RFR: 8295803: Console should be usable in jshell and other environments [v7]

2022-12-05 Thread Jaikiran Pai
On Mon, 5 Dec 2022 19:52:59 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inter

Re: RFR: 8295803: Console should be usable in jshell and other environments [v7]

2022-12-05 Thread Jim Laskey
On Mon, 5 Dec 2022 19:52:59 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inter

Re: RFR: 8295803: Console should be usable in jshell and other environments [v7]

2022-12-05 Thread Naoto Sato
> This is to allow Console to be used even when it is not attached to the > platform provided terminal, such as the case when the standard input is > redirected. `System.console()` now returns a Console implementation based on > `jdk.internal.le` terminal by default, or jshell implementation if

Re: RFR: 8295803: Console should be usable in jshell and other environments [v4]

2022-12-05 Thread Naoto Sato
On Sun, 4 Dec 2022 17:09:15 GMT, Alan Bateman wrote: >> Naoto Sato has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Changed the expected behavior when the SecurityManager is enabled > > src/java.base/share/classes/java/io/Console.java lin

Re: RFR: 8295803: Console should be usable in jshell and other environments [v6]

2022-12-05 Thread Jim Laskey
On Mon, 5 Dec 2022 18:33:10 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inter

Re: RFR: 8295803: Console should be usable in jshell and other environments [v6]

2022-12-05 Thread Naoto Sato
> This is to allow Console to be used even when it is not attached to the > platform provided terminal, such as the case when the standard input is > redirected. `System.console()` now returns a Console implementation based on > `jdk.internal.le` terminal by default, or jshell implementation if

Re: RFR: 8295803: Console should be usable in jshell and other environments [v5]

2022-12-05 Thread Naoto Sato
> This is to allow Console to be used even when it is not attached to the > platform provided terminal, such as the case when the standard input is > redirected. `System.console()` now returns a Console implementation based on > `jdk.internal.le` terminal by default, or jshell implementation if

Re: RFR: 8295803: Console should be usable in jshell and other environments [v4]

2022-12-04 Thread Andrey Turbanov
On Sat, 3 Dec 2022 19:18:48 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inter

Re: RFR: 8295803: Console should be usable in jshell and other environments [v4]

2022-12-04 Thread Alan Bateman
On Sat, 3 Dec 2022 19:18:48 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inter

Re: RFR: 8295803: Console should be usable in jshell and other environments [v4]

2022-12-03 Thread Naoto Sato
> This is to allow Console to be used even when it is not attached to the > platform provided terminal, such as the case when the standard input is > redirected. `System.console()` now returns a Console implementation based on > `jdk.internal.le` terminal by default, or jshell implementation if

Re: RFR: 8295803: Console should be usable in jshell and other environments [v2]

2022-12-02 Thread Naoto Sato
On Fri, 2 Dec 2022 15:21:40 GMT, Weijun Wang wrote: >> Naoto has confirmed that the password prompt from keytool does not echo, >> good! >> >> The intention is that Console be usable in jshell so I think the issue is >> that readPassword is echo'ing when used in jshell. Maybe someone >> exper

Re: RFR: 8295803: Console should be usable in jshell and other environments [v3]

2022-12-02 Thread Naoto Sato
> This is to allow Console to be used even when it is not attached to the > platform provided terminal, such as the case when the standard input is > redirected. `System.console()` now returns a Console implementation based on > `jdk.internal.le` terminal by default, or jshell implementation if

Re: RFR: 8295803: Console should be usable in jshell and other environments [v2]

2022-12-02 Thread Weijun Wang
On Fri, 2 Dec 2022 08:18:35 GMT, Alan Bateman wrote: >> If the console cannot be used anyway inside jshell, then this is good enough. > > Naoto has confirmed that the password prompt from keytool does not echo, good! > > The intention is that Console be usable in jshell so I think the issue is

Re: RFR: 8295803: Console should be usable in jshell and other environments [v2]

2022-12-02 Thread Alan Bateman
On Thu, 1 Dec 2022 23:38:40 GMT, Weijun Wang wrote: >> I confirmed that the standalone `keytool` did not echo the input, which >> should be OK for this IMO. > > If the console cannot be used anyway inside jshell, then this is good enough. Naoto has confirmed that the password prompt from keytoo

Re: RFR: 8295803: Console should be usable in jshell and other environments [v2]

2022-12-01 Thread Weijun Wang
On Thu, 1 Dec 2022 19:30:29 GMT, Naoto Sato wrote: >> What's the expected behavior? > > I confirmed that the standalone `keytool` did not echo the input, which > should be OK for this IMO. If the console cannot be used anyway inside jshell, then this is good enough. - PR: https://

Re: RFR: 8295803: Console should be usable in jshell and other environments [v2]

2022-12-01 Thread Naoto Sato
On Thu, 1 Dec 2022 17:53:58 GMT, Weijun Wang wrote: >> I can still see the password on screen. Here `in` is a >> `jdk.jshell.execution.Util` so the updated check on line 58 above failed. >> >> $ jshell -C--add-exports -Cjava.base/sun.security.tools.keytool=ALL-UNNAMED >> -R--add-exports -Rjava

Re: RFR: 8295803: Console should be usable in jshell and other environments [v2]

2022-12-01 Thread Weijun Wang
On Thu, 1 Dec 2022 16:08:39 GMT, Weijun Wang wrote: >> Sure. Trying out now... > > I can still see the password on screen. Here `in` is a > `jdk.jshell.execution.Util` so the updated check on line 58 above failed. > > $ jshell -C--add-exports -Cjava.base/sun.security.tools.keytool=ALL-UNNAMED

Re: RFR: 8295803: Console should be usable in jshell and other environments [v2]

2022-12-01 Thread Weijun Wang
On Thu, 1 Dec 2022 15:49:30 GMT, Weijun Wang wrote: >> src/java.base/share/classes/sun/security/util/Password.java line 63: >> >>> 61: // readPassword returns "" if you just press ENTER with >>> the built-in Console, >>> 62: // to be compatible with old Password

Re: RFR: 8295803: Console should be usable in jshell and other environments [v2]

2022-12-01 Thread Weijun Wang
On Thu, 1 Dec 2022 15:16:29 GMT, Alan Bateman wrote: >> Naoto Sato has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Adds a test >> - Removed JavaIOAccess.charset() which is no longer needed > > src/java.base/share/classes/sun/security/

Re: RFR: 8295803: Console should be usable in jshell and other environments [v2]

2022-12-01 Thread Alan Bateman
On Wed, 30 Nov 2022 20:44:30 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inte

Re: RFR: 8295803: Console should be usable in jshell and other environments [v2]

2022-12-01 Thread Alan Bateman
On Wed, 30 Nov 2022 20:44:30 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inte

Re: RFR: 8295803: Console should be usable in jshell and other environments [v2]

2022-12-01 Thread Alan Bateman
On Wed, 30 Nov 2022 20:44:30 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inte

Re: RFR: 8295803: Console should be usable in jshell and other environments [v2]

2022-12-01 Thread Jim Laskey
On Wed, 30 Nov 2022 20:44:30 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inte

Re: RFR: 8295803: Console should be usable in jshell and other environments [v2]

2022-11-30 Thread Naoto Sato
> This is to allow Console to be used even when it is not attached to the > platform provided terminal, such as the case when the standard input is > redirected. `System.console()` now returns a Console implementation based on > `jdk.internal.le` terminal by default, or jshell implementation if

Re: RFR: 8295803: Console should be usable in jshell and other environments

2022-11-30 Thread Naoto Sato
On Wed, 30 Nov 2022 17:07:35 GMT, Jim Laskey wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inte

Re: RFR: 8295803: Console should be usable in jshell and other environments

2022-11-30 Thread Jim Laskey
On Tue, 29 Nov 2022 19:38:02 GMT, Naoto Sato wrote: > This is to allow Console to be used even when it is not attached to the > platform provided terminal, such as the case when the standard input is > redirected. `System.console()` now returns a Console implementation based on > `jdk.internal

RFR: 8295803: Console should be usable in jshell and other environments

2022-11-30 Thread Naoto Sato
This is to allow Console to be used even when it is not attached to the platform provided terminal, such as the case when the standard input is redirected. `System.console()` now returns a Console implementation based on `jdk.internal.le` terminal by default, or jshell implementation if availabl