Incorrect behavior of arrow keys with SBT in Windows 7

I am using SBT 0.13.6 on Windows 7 and I run it with Cygwin (bash shell), I have a problem with the arrow keys: the up arrow moves the cursor up, while I want it to view the command history (and i think it should do by default).

The problem is what is printed in the terminal. When I press: [up arrow] [enter], it executes the previous command. But what I see in the terminal is the cursor moving up one line and after typing it prints the previous command and executes it.

It should, of course, print the previous command right after I hit the up arrow, and shouldn't move the cursor (at least vertically)

The command line in SBT is handled by JLine 2 . Launching JLine in trace mode. I can see that it recognizes key presses and displays an up arrow to "previous history", but the terminal is not updating correctly.

I also had the problem that I need to manually insert the end-of-line character for the command to be entered, which was fixed by adding the following option to my SBT startup script:

-Djline.terminal=unix

      

I've also tried other options (win, auto, off, etc.). I put the following lines in jline.inputrc file in my home directory, but it doesn't help:

"\e[A": previous-history
"\e[B": next-history

      

And I actually didn't think it should help, because I can see the keystrokes being recognized correctly and being mapped to the correct command.

The behavior is independent of which arrow keys I use (the ones on the numeric keypad or not).

The workaround is to launch SBT directly from the Windows Command Shell (cmd.exe).

Does anyone know how to fix this so that the command looping works as expected in Cygwin?

+3


source to share





All Articles