This may be useful info if anybody else installs the current Ruby package. There is an extremely annoying glitch in interactive Ruby (“irb”) as supplied. (Not Haiku’s fault. The Ruby folks had very narrow vision.)
The problem is that the arrow keys don’t work! The escape sequences they generate just get echoed (in glorious colour!). As the whole point of irb is to be able to edit code, this is rather tedious!
The reason is that irb now uses the ruby-only ‘Reline’ facility, which is supposed to replicate readline – with sone extra features. It does replicate readline – for Linux, which does not do things right. Haiku OTOH does, so Reline fails.
The default TERM on both Haiku and most Linux is ‘xterm-256color’, which explicitly has separate sequences for arrow keys and cursor movement. Totally logical, but Linux just ignores this and has the keys send cursor sequences.
It turns out that Reline does read ‘~/.inputrc’ for custom sequences. It doesn’t use the readline action names, though, so I initially had no success in adding codes. I eventually found the actual ones in the ruby code itself, so I was able to add the right lines to .input rc.
SO if you install ruby 2.7, and want irb, here’s what you do:
Copy ‘/boot/system/settings/etc/inputrc’ to ‘~/.inputrc’ (note the dot!) (Reline of course doesn’t know about the Haiku convention.)
Add the following lines to the new file:
"\eOA": ed-prev-history
"\eOB": ed-next-history
"\eOC": ed-next-char
"\eOD": ed-prev-char
irb should then work. And I have to admit the new features are nice! The text is syntax-coloured, and there is a new 'multiline feature such that if you type in a method with many lines, the up-arrow key exposes the whole method, and then the up and down arrows will move within it.
Hope that’s useful to somebody. Personally I use Ruby a lot.
[Apologies that this remains ‘Uncategorized’! Even the new W+ won’t let me edit that field…]