title: Incorrect behaviour of arrow keys using SBT on Windows 7
body: <p>I'm using <a href="http://www.scala-sbt.org/" rel="nofollow">SBT</a> 0.13.6 on Windows 7, and I'm running it using Cygwin (bash shell). I have a problem with the arrow keys: Arrow-up moves the cursor up, whereas I want it to cycle through the command history (and I think that's what it should do by default).</p>
  
  <p>The problem seems to be what's printed in the terminal. When I press: [arrow up] [enter], it <em>does</em> execute the previous command. But what I see in the terminal is the cursor moving up one line, and after the enter, it prints the previous command and execute it.</p>
  
  <p>It should, of course, print the previous command immediately after I hit arrow-up, and it should not move the cursor (not vertically at least)</p>
  
  <p>The command-line in SBT is handled by <a href="https://github.com/jline/jline2" rel="nofollow">JLine 2</a>. Running JLine in trace mode I can see that it does recognize the key-presses and it has mapped the arrow-up to "previous-history", but the terminal is not updated correctly.</p>
  
  <p>I also had the problem that I had to manually insert an end-of-line character for a command to be entered, which was fixed by adding the following option to my SBT start-up script:</p>
  
  <pre><code>-Djline.terminal=unix
  </code></pre>
  
  <p>I have tried the other options as well (win, auto, off, etc). I have put the following lines in a file jline.inputrc in my home directory, but it doesn't help:</p>
  
  <pre><code>"\e[A": previous-history
  "\e[B": next-history
  </code></pre>
  
  <p>And in fact I didn't think it should help, because I can see that the key-presses are recognized correctly and mapped to the right command.</p>
  
  <p>The behaviour does not depend on which arrow keys I use (the ones on the numeric keypad or not).</p>
  
  <p>A work-around is to run SBT directly from the Windows command shell (cmd.exe).</p>
  
  <p>Does anyone know of a way to fix this, so that command-history cycling works as expected in Cygwin?</p>