title: Java BufferedReader on System.in ignores first line / command
body: <p>I have created a simple console application for java with an JavaBufferedReader to read the commands from the terminal. For some reason the first command issued is always completly ignored. Even while debugging no value gets read and the input String is still not initialized. After issueing a second command the input String gets the value I wrote in the console.</p>
  <p>I am using IntelliJ and the integrated terminal with gradle and JDK 11.
  I litterly can't see any reason, why the first command is just completly ignored.</p>
  <pre class="lang-java prettyprint-override"><code>BufferedReader inReader = new BufferedReader(new InputStreamReader(System.in));
  </code></pre>
  <p>And the main shell functionality</p>
  <pre class="lang-java prettyprint-override"><code> public void runMainLoop() throws IOException {
      boolean quit = false;
  
      while (!quit) {
        System.out.print(&quot;prompt&gt; &quot;);
        final String input = inReader.readLine();   // &lt;-- This input gets no value after pressing &quot;enter&quot;. 
        if (input == null) {                        // all other &quot;enter&quot; after the first one are working
          break; 
        }
  
        try (final Scanner scanner = new Scanner(input)) {
          scanner.useDelimiter(&quot;\\s+&quot;);
  
          if (!scanner.hasNext()) {
            printError(&quot;No command specified!&quot;);
            break;
          }
  
          switch (scanner.next().toLowerCase()) {
  
            case &quot;help&quot;:
              printHelpMessage();
              break;
  
            case &quot;quit&quot;:
              quit = true;
              println(&quot;Terminate...&quot;);
              break;
  
            default:
              printError(&quot;Unknown command given.&quot;);
              printHelpMessage();
              break;
          }
        }
      }
    }
  </code></pre>