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.
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.