James Tucker
12/31/2007 4:42:00 PM
On 31 Dec 2007, at 08:34, tho_mica_l wrote:
>
> Isn't readline already distributed with ruby by default? Why write a
> ruby version of a standard ruby library?
Well, for one, it's only the binding that's in the stdlib. The one-
click-installer ships with a copy, which I think came from GnuWin32.
The implementations of readline available on windows are broken, though.
Simple replication:
In a command prompt <<EOEXAMPLE
mode con: cols=81
irb
["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n",
"o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
EOEXAMPLE
This will not display correctly, starting from around about character
70 in width, IIRC
It can take two or three newlines to clear the display corruption, and
when trying to go up past the wide line in the history will also cause
the same issues, making irb quite unusable.
The more core issue, is that there isn't a way to do a "getc" that
actually doesn't violate POLS. I don't know about others here, but
personally, I would (if I didn't know better) expect "get character"
to just get a single character.
N.B. We're not talking about the argv get[cs] POLS violation, there
are two other problems here, STDIN buffering until "\n" (all
platforms) and readline being broken (Windows).