RFR: 8332314: Add window size configuration option to JavaShellToolBuilder interface

Archie Cobbs acobbs at openjdk.org
Wed May 15 17:03:12 UTC 2024


When launching JShell programmatically (i.e., from a Java program instead of the command line) for an interactive session, it's not currently possible to inform JShell what the terminal window's dimensions are. As a result, JShell defaults to 80x24 and line editing becomes almost impossible because of the scrambled screen contents unless you happen to be using an 80x24 window, which these days is very unlikely.

This patch adds a new method `JavaShellToolBuilder.windowSize()` which allows passing a "hint" for the number of rows & columns.

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

Commit messages:
 - Update copyright years.
 - Fix typo in exception message.
 - Add new method JavaShellToolBuilder.windowSize().

Changes: https://git.openjdk.org/jdk/pull/19226/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=19226&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8332314
  Stats: 46 lines in 4 files changed: 35 ins; 1 del; 10 mod
  Patch: https://git.openjdk.org/jdk/pull/19226.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19226/head:pull/19226

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


More information about the kulla-dev mailing list