This is another one of those making things work in Cygwin posts. You can safely skip this post if you are not married to Cygwin, or have not followed my Ten Steps To Higher Cygwin Productivity.
The issue this time is with a little library called JLine, which is a BSD licensed library that brings GNU readline style command line editing to Java. I first learned about it through the Clojure programming language (a LISP with immutable variables and software transactional memory (STM)).
And of course, it doesn't work in my Cygwin xterm window. A little Googling landed me at JLine issue-1822900. A little looking around in the JLine source and some experiments later, I had a partial workaround, which I added as a comment to the issue.
While doing the Google search, I also noticed that both Groovy and JRuby use JLine to some extend (in jirb and groovysh). Sure enough, the same issue showed up in the Groovy JIRA as GROOVY-2584, to which I added the workaround.
A fresh download of the just released JRuby 1.1 showed the same symptom. The JLine workaround can be applied directly to the jruby script, which, thankfully, does contain infrastructure for Cygwin support.
There are other issues with JLine on a Cygwin xterm. But the workaround at least makes the repls workable.
The part that makes me uncomfortable is that I don't see how this workaround can be incorporated into a patch for JLine. In that regard, I concede Cygwin is a somewhat hacky platform. (Jonathan and Adam, if you are still reading...)