JShell: locks forever when input is piped

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 9
    • Affects Version/s: 9
    • Component/s: tools
    • Environment:

      It seems to me that this issue is on Unix env.
      I've confirmed this on my Ubuntu.

      I think this is not shown on Windows, please see my comment.

    • b141
    • generic
    • linux_ubuntu
    • Not verified

      Consider following:
      echo "System.out.println()" | jshell

      jshell should exit as soon as printing empty line but it locks forever.


      Another case,
      java Main | jshell

      Main is,

      public class Main {
          public static void main(String[] args) throws Exception {
              for (int i = 0; i < 10; i++) {
                  Thread.sleep(1000);
                  System.out.println("System.out.println(" + i + ")");
              }
          }
      }

      jshell should exit 10 sec. later after printing from 0 to 9.

            Assignee:
            Jan Lahoda
            Reporter:
            Shinya Yoshida
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: