title: Why does the sbt ~compile command do not recompile on code change?
body: <p>I currently have a problem with recompile on code change with sbt. </p>
  
  <p>I was following the sbt reference '<a href="https://www.scala-sbt.org/1.x/docs/sbt-by-example.html" rel="nofollow noreferrer">sbt by example</a>'
  I installed sbt 1.2.8 and followed the instructions:</p>
  
  <p><strong>Create a minimum sbt build</strong></p>
  
  <pre><code>$ mkdir foo-build
  $ cd foo-build
  $ touch build.sbt
  </code></pre>
  
  <p><strong>Start sbt shell</strong></p>
  
  <pre><code>$ sbt
  [info] Loading global plugins from C:\Users\hce\.sbt\1.0\plugins
  [info] Loading project definition from E:\learn\Scala\demo\foo-build\project
  [info] Loading settings for project foo-build from build.sbt ...
  [info] Set current project to foo-build (in build file:/E:/learn/Scala/demo/foo-build/)
  [info] sbt server started at local:sbt-server-57c501e502d72a00d890
  </code></pre>
  
  <p><strong>Recompile on code change</strong> (Note the ~ prefix before the compile command)</p>
  
  <pre><code>sbt:foo-build&gt; ~compile
  [success] Total time: 0 s, completed Jul 6, 2019 12:01:24 PM
  1. Waiting for source changes in project foo-build... (press enter to interrupt)
  </code></pre>
  
  <p><strong>Create a source file</strong></p>
  
  <p>Leave the previous command running. From a different shell or in your file manager create in the project directory the following nested directories: src/main/scala/example. Then, create Hello.scala in the example directory using your favorite editor as follows:</p>
  
  <pre><code>package example
  
  object Hello extends App {
    println("Hello")
  }
  </code></pre>
  
  <p>This new file should be picked up by the running command. But it is not working on my system.</p>
  
  <p><strong>Expected Behaviour:</strong> </p>
  
  <pre><code>[info] Compiling 1 Scala source to /tmp/foo-build/target/scala-2.12/classes ...
  [info] Done compiling.
  [success] Total time: 2 s, completed May 6, 2018 3:53:42 PM
  2. Waiting for source changes... (press enter to interrupt)
  </code></pre>
  
  <p>Here are some Information about my environment</p>
  
  <pre><code>$ java -version
  java version "1.8.0_211"
  Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
  Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)
  
  $ sbt sbtVersion
  [info] Loading global plugins from C:\Users\hce\.sbt\1.0\plugins
  [info] Loading project definition from E:\learn\Scala\demo\foo-build\project
  [info] Loading settings for project foo-build from build.sbt ...
  [info] Set current project to foo-build (in build file:/E:/learn/Scala/demo/foo-build/)
  [info] 1.2.8
  
  $ systeminfo.exe | grep '^OS'
  OS Name:                   Microsoft Windows 10 Enterprise LTSC
  OS Version:                10.0.17763 N/A Build 17763
  OS Manufacturer:           Microsoft Corporation
  OS Configuration:          Standalone Workstation
  OS Build Type:             Multiprocessor Free
  </code></pre>
  
  <p><strong>What I already tried:</strong></p>
  
  <ul>
  <li>reinstall sbt</li>
  <li>try it with windows commad line</li>
  <li>try it mingw64 bash</li>
  </ul>
  
  <p>What am I missing to run the sbt ~compile command correctly?</p>