On Fri, 3 May 2024 10:11:02 GMT, Jan Lahoda <jlah...@openjdk.org> wrote:

> When JLine reads a line, there may be a prompt provided. However, JLine will 
> not interpret the prompt literally, it will handle `%` specially. As a 
> consequence, doing:
> 
> System.console().readLine("%%s");
> 
> 
> will not print `%s`, as first `String.format` is used, which will convert 
> `%%s` to `%s`, and then JLine will interpret the `%`. The proposed solution 
> is to duplicate the `%`, so that JLine will print it.

This pull request has now been integrated.

Changeset: 5a8df410
Author:    Jan Lahoda <jlah...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/5a8df4106ac5386eb72e874dcadf2b18defe27d8
Stats:     296 lines in 6 files changed: 291 ins; 0 del; 5 mod

8331535: Incorrect prompt for Console.readLine
8331681: Test that jdk.internal.io.JdkConsole does not interpret prompts

Reviewed-by: naoto, asotona

-------------

PR: https://git.openjdk.org/jdk/pull/19081

Reply via email to