-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8304498: JShell does not switch to raw mode when there is no /bin/test #13100
Conversation
👋 Welcome back jlahoda! A progress list of the required criteria for merging this PR into |
Webrevs
|
As a general point, we probably need to change jline to not create sub-processes. If we needs to introspect the environment then it will need to do it in the current VM. |
@@ -102,4 +103,13 @@ public class OSUtils { | |||
TEST_COMMAND = test; | |||
} | |||
|
|||
private static boolean isTestCommandValid(String command) { | |||
try { | |||
Process p = new ProcessBuilder(command, "-z", "").inheritIO().start(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason why you chose to spin up a process here ? Would a test for an executable file be sufficient ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
the test call seems to be only used in one method where JLine attempts to test the tty fd value (AFAICT) - they're hacking into java.lang.ProcessBuilder$RedirectPipeImpl for that purpose.
wonder if there's anything else the JDK libs can offer.
@lahodaj This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 96 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks sensible
/integrate |
Going to push as commit fab2357.
Your commit was automatically rebased without conflicts. |
@lahodaj was the issue reported to the upstream? |
I've just filled: |
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.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/13100/head:pull/13100
$ git checkout pull/13100
Update a local copy of the PR:
$ git checkout pull/13100
$ git pull https://git.openjdk.org/jdk.git pull/13100/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 13100
View PR using the GUI difftool:
$ git pr show -t 13100
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/13100.diff