On Mon, 20 Mar 2023 12:10:04 GMT, Jan Lahoda <jlah...@openjdk.org> wrote:

> If JShell is run on a system that does not have `/bin/test` (which is, 
> apparently, possible for some systems, which only have `/usr/bin/test`), it 
> won't switch the terminal into the raw mode, and the input will not work 
> properly.
> 
> The proposed fix herein is to detect whether `test` existing in 
> `/usr/bin/test`, and if yes, use that location. Use the existing `/bin/test` 
> otherwise.

src/jdk.internal.le/share/classes/jdk/internal/org/jline/utils/OSUtils.java 
line 108:

> 106:     private static boolean isTestCommandValid(String command) {
> 107:         try {
> 108:             Process p = new ProcessBuilder(command, "-z", 
> "").inheritIO().start();

is there a reason why you chose to spin up a process here ? Would a test for an 
executable file be sufficient ?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13100#discussion_r1144922827

Reply via email to