RFR: 8247403: JShell: No custom input (e.g. from GUI) possible with JavaShellToolBuilder [v2]
Jan Lahoda
jlahoda at openjdk.java.net
Mon Apr 26 11:44:45 UTC 2021
On Mon, 26 Apr 2021 11:28:05 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:
>> Basically, JShell's ConsoleIOContext always uses the JLine's default terminal, which uses System.in, or equivalent, for input. But, if the JShell tool has been created using JavaShellToolBuilder, a different input might have been provided. The proposed solution is to use a different JLine's terminal in this case, based on the provided input.
>
> Jan Lahoda has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains eight additional commits since the last revision:
>
> - Restoring timeout.
> - Improving test.
> - Cleanup.
> - Adding an experimental API to select the JavaShell output format and the output terminal size.
> - Merge branch 'master' into JDK-8247404
> - When using JavaShellToolBuilder programmatically, make the characters sent to the output stream more consistent with the legacy behavior.
> - Merge branch 'master' into JDK-8247404
> - 8247403: JShell: No custom input (e.g. from GUI) possible with JavaShellToolBuilder
It turned out some users/clients of JavaShellToolBuilder do not attach a full terminal to it, but rather parse the output, and since we have changed the output by using a newer JLine, this became more complicated. So the new iteration of the patch supports two modes: a (default) simpler mode, which does not use escape sequences much, and a more for real terminals, where JShell will use escape sequences to provide a good experiment to a user reading on the terminal. Please also see the associated CSR:
https://bugs.openjdk.java.net/browse/JDK-8265966
-------------
PR: https://git.openjdk.java.net/jdk/pull/2509
More information about the kulla-dev
mailing list