It would need to re-write the line after the \n, which requires going up a line and re-writing.
or... it would require not echoing keys to the terminal.
Neither are easy to support on windows due to bugs and limitations in the curses and readline implementations, although I expect with some added complexity to irb (unless it's already there of course), this could be done quite trivially on *nix systems.
···
On 28 Dec 2007, at 16:32, Giles Bowkett wrote:
Hi. I managed to set auto_indent, but it just don't work quite the way
we expect...
Can I fix it? or it's a limitation on Windows?
It's a limitation of IRB. If you find a fix, though, that would be
very very cool.
I expect with some
added complexity to irb (unless it's already there of course), this
could be done quite trivially on *nix systems.
Triviality is a relative term. I don't have the faintest idea where to
start on something like that but I would be thrilled to figure it out.
I'd throw it into my IRB enhancements gem quicker than the Flash plus
Red Bull. I think IRB just drops its output into STDOUT, so
repositioning it after the fact sounds pretty challenging. Would it
just be something to regex the output before dumping to STDOUT? I
think currently all the auto-indentation is handled by modifying the
prompt.